error: improved message to add filepath for insufficient permissions
if (errno == EACCES) \
ELEKTRA_SET_RESOURCE_ERRORF ( \
parentKey, \
- "Insufficient permissions to open configuration file for reading. Reason: %s. You might want " \
+ "Insufficient permissions to open configuration file %s for reading. Reason: %s. You might want " \
"to retry as root or change access using chmod.", \
- strerror (errno)); \
+ keyString (parentKey), strerror (errno)); \
else \
- ELEKTRA_SET_RESOURCE_ERRORF (parentKey, "Could not open configuration file for reading. Reason: %s", \
- strerror (errno)); \
+ ELEKTRA_SET_RESOURCE_ERRORF (parentKey, "Could not open configuration file %s for reading. Reason: %s", \
+ keyString (parentKey), strerror (errno)); \
} while (0)
#define ELEKTRA_SET_ERROR_SET(parentKey) \
if (errno == EACCES) \
ELEKTRA_SET_RESOURCE_ERRORF ( \
parentKey, \
- "Insufficient permissions to open configuration file for writing. You might want to retry as " \
+ "Insufficient permissions to open configuration file %s for writing. You might want to retry as " \
"root. Errno: %s", \
- strerror (errno)); \
+ keyString (parentKey), strerror (errno)); \
else \
- ELEKTRA_SET_RESOURCE_ERRORF (parentKey, ":Could not open file for writing %s", strerror (errno)); \
+ ELEKTRA_SET_RESOURCE_ERRORF (parentKey, ":Could not open file %s for writing %s", keyString (parentKey), \
+ strerror (errno)); \
} while (0)
#define ELEKTRA_MALLOC_ERROR(key, size) ELEKTRA_SET_RESOURCE_ERRORF (key, "Unable to allocate %zu bytes.", size);
