diff --git a/src/action_cc.cc b/src/action_cc.cc index 2344bbc..be8ef29 100644 --- a/src/action_cc.cc +++ b/src/action_cc.cc @@ -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 { diff --git a/src/config.c b/src/config.c index b40648c..307adea 100644 --- a/src/config.c +++ b/src/config.c @@ -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++; diff --git a/src/generator_c.c b/src/generator_c.c index 6cf6911..7f751d4 100644 --- a/src/generator_c.c +++ b/src/generator_c.c @@ -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);