Changed strerror to %m in format specifiers
This commit is contained in:
@@ -446,10 +446,10 @@ NM_ACTION_(nickel_misc) {
|
||||
} else if (!strcmp(arg, "force_usb_connection")) {
|
||||
// we could call libnickel directly, but I prefer not to
|
||||
FILE *nhs;
|
||||
NM_CHECK(nullptr, (nhs = fopen("/tmp/nickel-hardware-status", "w")), "could not open nickel hardware status pipe: %s", strerror(errno));
|
||||
NM_CHECK(nullptr, (nhs = fopen("/tmp/nickel-hardware-status", "w")), "could not open nickel hardware status pipe: %m");
|
||||
|
||||
const char *msg = "usb plug add";
|
||||
NM_CHECK(nullptr, fputs(msg, nhs) >= 0, "could not write message '%s' to pipe: %s", msg, strerror(errno));
|
||||
NM_CHECK(nullptr, fputs(msg, nhs) >= 0, "could not write message '%s' to pipe: %m", msg);
|
||||
|
||||
fclose(nhs);
|
||||
} else {
|
||||
|
||||
@@ -51,7 +51,7 @@ nm_config_file_t *nm_config_files() {
|
||||
|
||||
struct dirent **nl;
|
||||
int n = scandir(NM_CONFIG_DIR, &nl, nm_config_files_filter, alphasort);
|
||||
NM_CHECK(NULL, n != -1, "could not scan config dir: %s", strerror(errno));
|
||||
NM_CHECK(NULL, n != -1, "could not scan config dir: %m");
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
struct dirent *de = nl[i];
|
||||
@@ -240,7 +240,7 @@ nm_config_t *nm_config_parse(nm_config_file_t *files) {
|
||||
cfgfile = fopen(cf->path, "r");
|
||||
|
||||
if (!cfgfile)
|
||||
RETERR("could not open file: %s", strerror(errno));
|
||||
RETERR("could not open file: %m");
|
||||
|
||||
while ((line_sz = getline(&line, &line_bufsz, cfgfile)) != -1) {
|
||||
line_n++;
|
||||
|
||||
@@ -91,7 +91,7 @@ NM_GENERATOR_(_test_time) {
|
||||
NM_GENERATOR_(kfmon) {
|
||||
struct stat sb;
|
||||
if (stat(KFMON_IPC_SOCKET, &sb))
|
||||
NM_ERR_RET(NULL, "error checking '%s': stat: %s", KFMON_IPC_SOCKET, strerror(errno));
|
||||
NM_ERR_RET(NULL, "error checking '%s': stat: %m", KFMON_IPC_SOCKET);
|
||||
|
||||
if (time_in_out->tv_sec == sb.st_mtim.tv_sec && time_in_out->tv_nsec == sb.st_mtim.tv_nsec) {
|
||||
nm_err_set(NULL);
|
||||
|
||||
Reference in New Issue
Block a user