diff options
-rw-r--r-- | loader2/cdinstall.c | 12 | ||||
-rw-r--r-- | loader2/copy.c | 25 | ||||
-rw-r--r-- | loader2/dirbrowser.c | 2 | ||||
-rw-r--r-- | loader2/driverdisk.c | 9 | ||||
-rw-r--r-- | loader2/driverselect.c | 5 | ||||
-rw-r--r-- | loader2/fwloader.c | 3 | ||||
-rw-r--r-- | loader2/hardware.c | 3 | ||||
-rw-r--r-- | loader2/hdinstall.c | 21 | ||||
-rw-r--r-- | loader2/init.c | 9 | ||||
-rw-r--r-- | loader2/kbd.c | 4 | ||||
-rw-r--r-- | loader2/kickstart.c | 11 | ||||
-rw-r--r-- | loader2/lang.c | 8 | ||||
-rw-r--r-- | loader2/loader.c | 65 | ||||
-rw-r--r-- | loader2/loadermisc.c | 20 | ||||
-rw-r--r-- | loader2/method.c | 20 | ||||
-rw-r--r-- | loader2/modules.c | 3 | ||||
-rw-r--r-- | loader2/net.c | 41 | ||||
-rw-r--r-- | loader2/nfsinstall.c | 41 | ||||
-rw-r--r-- | loader2/selinux.c | 2 | ||||
-rw-r--r-- | loader2/telnetd.c | 10 | ||||
-rw-r--r-- | loader2/urlinstall.c | 22 | ||||
-rw-r--r-- | loader2/urls.c | 6 |
22 files changed, 130 insertions, 212 deletions
diff --git a/loader2/cdinstall.c b/loader2/cdinstall.c index c8746bf10..0a5600dda 100644 --- a/loader2/cdinstall.c +++ b/loader2/cdinstall.c @@ -143,8 +143,7 @@ static void wrongCDMessage(void) { "in any of your drives. Please insert " "the %s disc and press %s to retry."), getProductName(), getProductName(), _("OK"))) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -187,8 +186,7 @@ static void queryCDMediaCheck(char *dev, char *location) { if (asprintf(&stage2loc, "%s/images/stage2.img", location) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -230,8 +228,7 @@ static char *setupCdrom(char *location, struct loaderData_s *loaderData, } if (asprintf(&stage2loc, "%s/images/stage2.img", location) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -246,8 +243,7 @@ static char *setupCdrom(char *location, struct loaderData_s *loaderData, if (strncmp("/dev/", devices[i]->device, 5)) { if (asprintf(&tmp, "/dev/%s", devices[i]->device) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/copy.c b/loader2/copy.c index 4bfc62cd0..1c612337c 100644 --- a/loader2/copy.c +++ b/loader2/copy.c @@ -48,10 +48,8 @@ int copyDirectory(char * from, char * to, void (*warnFn)(char *), if (!(dir = opendir(from))) { if (errorFn) { - if (asprintf(&msg, N_("Failed to read directory %s: %s"), from, - strerror(errno)) == -1) { - fprintf(stderr, "%s: %d: %s\n", __func__, __LINE__, - strerror(errno)); + if (asprintf(&msg, N_("Failed to read directory %s: %m"), from) == -1) { + fprintf(stderr, "%s: %d: %m\n", __func__, __LINE__); fflush(stderr); abort(); } @@ -83,10 +81,9 @@ int copyDirectory(char * from, char * to, void (*warnFn)(char *), link[i] = '\0'; if (symlink(link, filespec2)) { if (warnFn) { - if (asprintf(&msg, "Failed to symlink %s to %s: %s", - filespec2, link, strerror(errno)) == -1) { - fprintf(stderr, "%s: %d: %s\n", __func__, __LINE__, - strerror(errno)); + if (asprintf(&msg, "Failed to symlink %s to %s: %m", + filespec2, link) == -1) { + fprintf(stderr, "%s: %d: %m\n", __func__, __LINE__); fflush(stderr); abort(); } @@ -99,10 +96,8 @@ int copyDirectory(char * from, char * to, void (*warnFn)(char *), fd = open(filespec, O_RDONLY); if (fd == -1) { if (errorFn) { - if (asprintf(&msg, "Failed to open %s: %s", filespec, - strerror(errno)) == -1) { - fprintf(stderr, "%s: %d: %s\n", __func__, __LINE__, - strerror(errno)); + if (asprintf(&msg, "Failed to open %s: %m", filespec) == -1) { + fprintf(stderr, "%s: %d: %m\n", __func__, __LINE__); fflush(stderr); abort(); } @@ -117,10 +112,8 @@ int copyDirectory(char * from, char * to, void (*warnFn)(char *), outfd = open(filespec2, O_RDWR | O_TRUNC | O_CREAT, 0644); if (outfd == -1) { if (warnFn) { - if (asprintf(&msg, "Failed to create %s: %s", filespec2, - strerror(errno)) == -1) { - fprintf(stderr, "%s: %d: %s\n", __func__, __LINE__, - strerror(errno)); + if (asprintf(&msg, "Failed to create %s: %m", filespec2) == -1) { + fprintf(stderr, "%s: %d: %m\n", __func__, __LINE__); fflush(stderr); abort(); } diff --git a/loader2/dirbrowser.c b/loader2/dirbrowser.c index 031122794..4d9c25cab 100644 --- a/loader2/dirbrowser.c +++ b/loader2/dirbrowser.c @@ -76,7 +76,7 @@ static char ** get_file_list(char * dirname, dir = opendir(dirname); if (dir == NULL) { - fprintf(stderr, "error opening %s: %s", dirname, strerror(errno)); + fprintf(stderr, "error opening %s: %m", dirname); return NULL; } diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c index a703d3a49..bc632982d 100644 --- a/loader2/driverdisk.c +++ b/loader2/driverdisk.c @@ -147,12 +147,12 @@ static int loadDriverDisk(struct loaderData_s *loaderData, char *mntpt) { location->version = version; if (asprintf(&location->path, "/tmp/DD-%d/modules.cgz", disknum) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } if (asprintf(&fwdir, "/tmp/DD-%d/firmware", disknum) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -295,7 +295,7 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData, /* make sure nothing is mounted when we get here */ num = umount("/tmp/dpart"); if (num == -1) { - logMessage(ERROR, "error unmounting: %s", strerror(errno)); + logMessage(ERROR, "error unmounting: %m"); if ((errno != EINVAL) && (errno != ENOENT)) exit(1); } @@ -357,8 +357,7 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData, if (asprintf(&buf, _("Insert your driver disk into /dev/%s " "and press \"OK\" to continue."), device) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/driverselect.c b/loader2/driverselect.c index fb6ab4f62..28f5ffd42 100644 --- a/loader2/driverselect.c +++ b/loader2/driverselect.c @@ -68,7 +68,7 @@ static int getManualModuleArgs(struct moduleInfo * mod, char *** moduleArgs) { "to the %s module separated by spaces. If you don't " "know what parameters to supply, skip this screen " "by pressing the \"OK\" button."), mod->moduleName) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -215,8 +215,7 @@ int chooseManualDriver(int class, struct loaderData_s *loaderData) { if (asprintf(&buf, "%s (%s)", modInfo->moduleList[sortedOrder[i].index].description, modInfo->moduleList[sortedOrder[i].index].moduleName) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/fwloader.c b/loader2/fwloader.c index 2c0412e5c..9cd1e5d22 100644 --- a/loader2/fwloader.c +++ b/loader2/fwloader.c @@ -477,8 +477,7 @@ static void load_firmware(struct fw_loader *fwl, struct uevent *uevent) if ((errno == ERANGE && (timeout_secs == LONG_MIN || timeout_secs == LONG_MAX)) || (errno != 0 && timeout_secs == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/hardware.c b/loader2/hardware.c index b980f60a1..202c64187 100644 --- a/loader2/hardware.c +++ b/loader2/hardware.c @@ -85,8 +85,7 @@ static int detectHardware() { if (timeout) { if (asprintf(&args[2],"--timeout=%d",timeout) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c index e71465c1f..b776d5d07 100644 --- a/loader2/hdinstall.c +++ b/loader2/hdinstall.c @@ -75,14 +75,12 @@ static char * setupIsoImages(char * device, char * dirName, char * location) { if (asprintf(&dirspec, "/mnt/isodir%.*s", (int) (strrchr(dirName, '/') - dirName), dirName) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } if (asprintf(&path, "/mnt/isodir%s", dirName) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -90,8 +88,7 @@ static char * setupIsoImages(char * device, char * dirName, char * location) { logMessage(INFO, "Path to stage2 image is %s", path); if (asprintf(&updpath, "%s/updates.img", dirspec) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -99,8 +96,7 @@ static char * setupIsoImages(char * device, char * dirName, char * location) { copyUpdatesImg(updpath); if (asprintf(&updpath, "%s/product.img", dirspec) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -119,8 +115,7 @@ static char * setupIsoImages(char * device, char * dirName, char * location) { } else { if (asprintf(&url, "hd:%s:%s:/%s", device, *type, dirName ? dirName : ".") == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -244,8 +239,7 @@ char * mountHardDrive(struct installMethod * method, "you're using listed here, press F2 to " "configure additional devices."), getProductName()) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -339,8 +333,7 @@ char * mountHardDrive(struct installMethod * method, stage2img = "stage2.img"; if (asprintf(&dir, "%s/%s", dir, stage2img) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/init.c b/loader2/init.c index ce4cff50f..a55c01273 100644 --- a/loader2/init.c +++ b/loader2/init.c @@ -352,8 +352,8 @@ static void createDevices(void) { switch (devnodes[i].type) { case DIRTYPE: if (mkdir(devname, devnodes[i].perms) < 0) { - fprintf(stderr, "Unable to create directory %s: %s\n", - devname, strerror(errno)); + fprintf(stderr, "Unable to create directory %s: %m\n", + devname); } break; case CHARDEV: @@ -367,8 +367,7 @@ static void createDevices(void) { if (mknod(devname, type | devnodes[i].perms, makedev(devnodes[i].major, devnodes[i].minor)) < 0) - fprintf(stderr, "Unable to create device %s: %s\n", devname, - strerror(errno)); + fprintf(stderr, "Unable to create device %s: %m\n", devname); } } @@ -693,7 +692,7 @@ int main(int argc, char **argv) { close(fd); free(buf); } else { - printf("unable to write init.pid (%d): %s\n", errno, strerror(errno)); + printf("unable to write init.pid (%d): %m\n", errno); sleep(2); } diff --git a/loader2/kbd.c b/loader2/kbd.c index 8e8058a4d..9d4863908 100644 --- a/loader2/kbd.c +++ b/loader2/kbd.c @@ -148,8 +148,8 @@ int chooseKeyboard(struct loaderData_s * loaderData, char ** kbdtypep) { for (i = 0; i < num; i++) { if (gunzip_read(f, buf, infoTable[i].size) != infoTable[i].size) { - logMessage(ERROR, "error reading %d bytes from file: %s", - infoTable[i].size, strerror(errno)); + logMessage(ERROR, "error reading %d bytes from file: %m", + infoTable[i].size); gunzip_close(f); rc = LOADER_ERROR; } diff --git a/loader2/kickstart.c b/loader2/kickstart.c index 3eb5780c1..2a3226f39 100644 --- a/loader2/kickstart.c +++ b/loader2/kickstart.c @@ -130,8 +130,8 @@ int ksReadCommands(char * cmdFile) { if ((fd = open(cmdFile, O_RDONLY)) < 0) { startNewt(); newtWinMessage(_("Kickstart Error"), _("OK"), - _("Error opening kickstart file %s: %s"), - cmdFile, strerror(errno)); + _("Error opening kickstart file %s: %m"), + cmdFile); return LOADER_ERROR; } @@ -140,8 +140,8 @@ int ksReadCommands(char * cmdFile) { if (read(fd, buf, sb.st_size) != sb.st_size) { startNewt(); newtWinMessage(_("Kickstart Error"), _("OK"), - _("Error reading contents of kickstart file %s: %s"), - cmdFile, strerror(errno)); + _("Error reading contents of kickstart file %s: %m"), + cmdFile); close(fd); return LOADER_ERROR; } @@ -325,8 +325,7 @@ void getHostPathandLogin(char * ksSource, char **host, char ** file, char ** log if ((*file) && (((*file)[strlen(*file) - 1] == '/') || ((*file)[strlen(*file) - 1] == '\0'))) { if (asprintf(file, "%s%s-kickstart", *file, ip) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/lang.c b/loader2/lang.c index 8e2267dd3..896de9f5b 100644 --- a/loader2/lang.c +++ b/loader2/lang.c @@ -112,8 +112,7 @@ static void loadLanguageList(void) { wcwidth(0); f = fopen(file, "r"); if (!f) { - newtWinMessage(_("Error"), _("OK"), "cannot open %s: %s", - file, strerror (errno)); + newtWinMessage(_("Error"), _("OK"), "cannot open %s: %m", file); return; } @@ -187,8 +186,7 @@ void loadLanguage (char * file) { fd = open("/tmp/translation", O_RDONLY); if (fd < 0) { - newtWinMessage("Error", "OK", "Failed to open /tmp/translation: %s\n", - strerror(errno)); + newtWinMessage("Error", "OK", "Failed to open /tmp/translation: %m\n"); return; } @@ -264,7 +262,7 @@ static int setupLanguage(int choice, int forced) { char *fmt = FL_RESCUE(flags) ? _(topLineWelcomeRescue) : _(topLineWelcome); if (asprintf(&buf, fmt, getProductName(), getProductArch()) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/loader.c b/loader2/loader.c index 30510557f..248bf2a54 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -164,8 +164,7 @@ void doGdbserver(struct loaderData_s *loaderData) { } if (asprintf(&pid, "%d", loaderPid) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -187,7 +186,7 @@ void doGdbserver(struct loaderData_s *loaderData) { if (execl("/usr/bin/gdbserver", "/usr/bin/gdbserver", "--attach", loaderData->gdbServer, pid, NULL) == -1) - logMessage(ERROR, "error running gdbserver: %s", strerror(errno)); + logMessage(ERROR, "error running gdbserver: %m"); _exit(1); } @@ -201,8 +200,7 @@ void startNewt(void) { if (asprintf(&buf, _("Welcome to %s for %s"), getProductName(), arch) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -373,7 +371,7 @@ static void spawnShell(void) { setenv("LANG", "C", 1); if (execl("/bin/sh", "-/bin/sh", NULL) == -1) { - logMessage(CRITICAL, "exec of /bin/sh failed: %s", strerror(errno)); + logMessage(CRITICAL, "exec of /bin/sh failed: %m"); exit(1); } } @@ -445,8 +443,7 @@ void loadUpdates(struct loaderData_s *loaderData) { stage = UPD_DEVICE; else { if (asprintf(&part, "/dev/%s", device) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } stage = UPD_PROMPT; @@ -478,8 +475,7 @@ void loadUpdates(struct loaderData_s *loaderData) { case UPD_PROMPT: if (asprintf(&buf, _("Insert your updates disk into %s and " "press \"OK\" to continue."), part) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -666,8 +662,7 @@ static void readNetInfo(struct loaderData_s ** ld) { if ((errno == ERANGE && (loaderData->mtu == LONG_MIN || loaderData->mtu == LONG_MAX)) || (errno != 0 && loaderData->mtu == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -972,8 +967,7 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, if ((errno == ERANGE && (loaderData->mtu == LONG_MIN || loaderData->mtu == LONG_MAX)) || (errno != 0 && loaderData->mtu == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -986,8 +980,7 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, if ((errno == ERANGE && (num_link_checks == LONG_MIN || num_link_checks == LONG_MAX)) || (errno != 0 && num_link_checks == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -998,8 +991,7 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, if ((errno == ERANGE && (post_link_sleep == LONG_MIN || post_link_sleep == LONG_MAX)) || (errno != 0 && post_link_sleep == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -1010,8 +1002,7 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, if ((errno == ERANGE && (loaderData->dhcpTimeout == LONG_MIN || loaderData->dhcpTimeout == LONG_MAX)) || (errno != 0 && loaderData->dhcpTimeout == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -1055,8 +1046,7 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, if (!strncasecmp(argv[i], "vesa", 4)) { if (asprintf(&extraArgs[numExtraArgs], "--xdriver=vesa") == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1064,8 +1054,7 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, } else { if (asprintf(&extraArgs[numExtraArgs],"--%s", argv[i]) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -1117,8 +1106,7 @@ static void checkForRam(void) { if (asprintf(&buf, _("You do not have enough RAM to install %s " "on this machine."), getProductName()) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1189,8 +1177,7 @@ static char *doLoaderMain(struct loaderData_s *loaderData, if (asprintf(&tmp, "%s/images/stage2.img", loaderData->instRepo) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1573,8 +1560,7 @@ static void migrate_runtime_directory(char * dirname) { int ret; if (asprintf(&runtimedir, "/mnt/runtime%s", dirname) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1583,8 +1569,7 @@ static void migrate_runtime_directory(char * dirname) { char * olddir; if (asprintf(&olddir, "%s_old", dirname) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1667,8 +1652,7 @@ static void add_to_path_env(const char *env, const char *val) oldenv = getenv(env); if (oldenv) { if (asprintf(&newenv, "%s:%s", val, oldenv) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1896,7 +1880,7 @@ int main(int argc, char ** argv) { * (if we're using SELinux) */ if (FL_SELINUX(flags)) { if (mount("/selinux", "/selinux", "selinuxfs", 0, NULL)) { - logMessage(ERROR, "failed to mount /selinux: %s, disabling SELinux", strerror(errno)); + logMessage(ERROR, "failed to mount /selinux: %m, disabling SELinux"); flags &= ~LOADER_FLAGS_SELINUX; } else { if (loadpolicy() == 0) { @@ -1957,8 +1941,7 @@ int main(int argc, char ** argv) { c = path[n]; path[n] = '\0'; if (asprintf(&binpath, "%s/anaconda", path) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } path[n] = c; @@ -2091,7 +2074,7 @@ int main(int argc, char ** argv) { if (!(pid = fork())) { setenv("ANACONDAVERSION", VERSION, 1); if (execv(anacondaArgs[0], anacondaArgs) == -1) { - fprintf(stderr,"exec of anaconda failed: %s\n",strerror(errno)); + fprintf(stderr,"exec of anaconda failed: %m\n"); exit(1); } } @@ -2109,8 +2092,7 @@ int main(int argc, char ** argv) { char * cmd = (FL_POWEROFF(flags) ? strdup("/sbin/poweroff") : strdup("/sbin/halt")); if (execl(cmd, cmd, NULL) == -1) { - fprintf(stderr, "exec of poweroff failed: %s", - strerror(errno)); + fprintf(stderr, "exec of poweroff failed: %m\n"); exit(1); } } @@ -2135,8 +2117,7 @@ int main(int argc, char ** argv) { if ((errno == ERANGE && (pid == LONG_MIN || pid == LONG_MAX)) || (errno != 0 && pid == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/loadermisc.c b/loader2/loadermisc.c index 6066e87a9..1fd77093f 100644 --- a/loader2/loadermisc.c +++ b/loader2/loadermisc.c @@ -43,15 +43,15 @@ int copyFileFd(int infd, char * dest) { outfd = open(dest, O_CREAT | O_RDWR, 0666); if (outfd < 0) { - logMessage(ERROR, "failed to open %s: %s", dest, strerror(errno)); - return 1; + logMessage(ERROR, "failed to open %s: %m", dest); + return 1; } while ((i = read(infd, buf, sizeof(buf))) > 0) { - if (write(outfd, buf, i) != i) { - rc = 1; - break; - } + if (write(outfd, buf, i) != i) { + rc = 1; + break; + } } close(outfd); @@ -66,8 +66,8 @@ int copyFile(char * source, char * dest) { infd = open(source, O_RDONLY); if (infd < 0) { - logMessage(ERROR, "failed to open %s: %s", source, strerror(errno)); - return 1; + logMessage(ERROR, "failed to open %s: %m", source); + return 1; } rc = copyFileFd(infd, dest); @@ -202,13 +202,13 @@ int totalMemory(void) { fd = open("/proc/meminfo", O_RDONLY); if (fd < 0) { - logMessage(ERROR, "failed to open /proc/meminfo: %s", strerror(errno)); + logMessage(ERROR, "failed to open /proc/meminfo: %m"); return 0; } bytesRead = read(fd, buf, sizeof(buf) - 1); if (bytesRead < 0) { - logMessage(ERROR, "failed to read from /proc/meminfo: %s", strerror(errno)); + logMessage(ERROR, "failed to read from /proc/meminfo: %m"); close(fd); return 0; } diff --git a/loader2/method.c b/loader2/method.c index 6dc938344..5ed42b300 100644 --- a/loader2/method.c +++ b/loader2/method.c @@ -68,8 +68,7 @@ int umountLoopback(char * mntpoint, char * device) { loopfd = open(device, O_RDONLY); if (ioctl(loopfd, LOOP_CLR_FD, 0) == -1) - logMessage(ERROR, "LOOP_CLR_FD failed for %s %s (%s)", mntpoint, - device, strerror(errno)); + logMessage(ERROR, "LOOP_CLR_FD failed for %s %s: %m", mntpoint, device); close(loopfd); @@ -90,8 +89,7 @@ int mountLoopback(char *fsystem, char *mntpoint, char *device) { } if (asprintf(&opts, "ro,loop=%s", device) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -100,8 +98,8 @@ int mountLoopback(char *fsystem, char *mntpoint, char *device) { if (doPwMount(fsystem, mntpoint, "squashfs", opts)) { if (doPwMount(fsystem, mntpoint, "cramfs", opts)) { if (doPwMount(fsystem, mntpoint, "vfat", opts)) { - logMessage(ERROR, "failed to mount loopback device %s on %s as %s: %s", - device, mntpoint, fsystem, strerror(errno)); + logMessage(ERROR, "failed to mount loopback device %s on %s as %s: %m", + device, mntpoint, fsystem); return LOADER_ERROR; } } @@ -287,8 +285,8 @@ void queryIsoMediaCheck(char *isoFile) { if (!(dir = opendir(isoDir))) { newtWinMessage(_("Error"), _("OK"), - _("Failed to read directory %s: %s"), - isoDir, strerror(errno)); + _("Failed to read directory %s: %m"), + isoDir); free(isoDir); free(master_timestamp); return; @@ -461,8 +459,7 @@ int copyFileAndLoopbackMount(int fd, char * dest, if (mountLoopback(dest, mntpoint, device)) { /* JKFIXME: this used to be fatal, but that seems unfriendly */ - logMessage(ERROR, "Error mounting %s on %s (%s)", device, - mntpoint, strerror(errno)); + logMessage(ERROR, "Error mounting %s on %s: %m", device, mntpoint); return 1; } @@ -484,8 +481,7 @@ int getFileFromBlockDevice(char *device, char *path, char * dest) { if (doPwMount(device, "/tmp/mnt", "vfat", "ro") && doPwMount(device, "/tmp/mnt", "ext2", "ro") && doPwMount(device, "/tmp/mnt", "iso9660", "ro")) { - logMessage(ERROR, "failed to mount /dev/%s: %s", device, - strerror(errno)); + logMessage(ERROR, "failed to mount /dev/%s: %m", device); return 2; } diff --git a/loader2/modules.c b/loader2/modules.c index 224f69d12..705a3ebeb 100644 --- a/loader2/modules.c +++ b/loader2/modules.c @@ -288,8 +288,7 @@ static int writeModulesConf(char *conf) { fd = open(conf, O_WRONLY | O_CREAT, 0644); if (fd == -1) { - logMessage(ERROR, "error opening to %s: %s\n", - conf, strerror(errno)); + logMessage(ERROR, "error opening to %s: %m\n", conf); return 0; } strcat(buf, "# Module options and blacklists written by anaconda\n"); diff --git a/loader2/net.c b/loader2/net.c index cf42be430..321b5bbae 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -77,8 +77,7 @@ static void cidrCallback(newtComponent co, void * dptr) { cidr = strtol(data->cidr4, NULL, 10); if ((errno == ERANGE && (cidr == LONG_MIN || cidr == LONG_MAX)) || (errno != 0 && cidr == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -92,8 +91,7 @@ static void cidrCallback(newtComponent co, void * dptr) { cidr = strtol(data->cidr6, NULL, 10); if ((errno == ERANGE && (cidr == LONG_MIN || cidr == LONG_MAX)) || (errno != 0 && cidr == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -126,8 +124,7 @@ static void ipCallback(newtComponent co, void * dptr) { if ((errno == ERANGE && (i == LONG_MIN || i == LONG_MAX)) || (errno != 0 && i == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -251,16 +248,14 @@ void initLoopback(void) { strcpy(req.ifr_name, "lo"); if (ioctl(s, SIOCGIFFLAGS, &req)) { - logMessage(LOG_ERR, "ioctl SIOCGIFFLAGS failed: %d %s\n", errno, - strerror(errno)); + logMessage(LOG_ERR, "ioctl SIOCGIFFLAGS failed: %m\n"); close(s); return; } req.ifr_flags |= (IFF_UP | IFF_RUNNING); if (ioctl(s, SIOCSIFFLAGS, &req)) { - logMessage(LOG_ERR, "ioctl SIOCSIFFLAGS failed: %d %s\n", errno, - strerror(errno)); + logMessage(LOG_ERR, "ioctl SIOCSIFFLAGS failed: %m\n"); close(s); return; } @@ -290,8 +285,7 @@ static int getWirelessConfig(struct networkDeviceConfig *cfg, char * ifname) { "to access your wireless network. If no key " "is needed, leave this field blank and the " "install will continue."), ifname) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1065,14 +1059,12 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, if (cfg->dev.set & PUMP_INTFINFO_HAS_IPV6_PREFIX) { if (asprintf(&buf, "%d", cfg->dev.ipv6_prefixlen) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } else if (newCfg->dev.set & PUMP_INTFINFO_HAS_IPV6_PREFIX) { if (asprintf(&buf, "%d", newCfg->dev.ipv6_prefixlen) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -1140,7 +1132,7 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, "netmask or the CIDR-style prefix are acceptable. " "The gateway and name server fields must be valid IPv4 " "or IPv6 addresses.")) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1191,8 +1183,7 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, if ((errno == ERANGE && (cidr == LONG_MIN || cidr == LONG_MAX)) || (errno != 0 && cidr == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1225,8 +1216,7 @@ int manualNetConfig(char * device, struct networkDeviceConfig * cfg, if ((errno == ERANGE && (prefix == LONG_MIN || prefix == LONG_MAX)) || (errno != 0 && prefix == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1374,12 +1364,12 @@ int setupWireless(struct networkDeviceConfig *dev) { logMessage(INFO, "setting essid for %s to %s", dev->dev.device, dev->essid); if (set_essid(dev->dev.device, dev->essid) < 0) { - logMessage(ERROR, "failed to set essid: %s", strerror(errno)); + logMessage(ERROR, "failed to set essid: %m"); } if (dev->wepkey) { logMessage(INFO, "setting encryption key for %s", dev->dev.device); if (set_wep_key(dev->dev.device, dev->wepkey) < 0) { - logMessage(ERROR, "failed to set wep key: %s", strerror(errno)); + logMessage(ERROR, "failed to set wep key: %m"); } } @@ -1437,8 +1427,7 @@ char *doDhcp(struct networkDeviceConfig *dev) { } else { if (asprintf(&class, "anaconda-%s %s %s", kv.sysname, kv.release, kv.machine) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -1602,7 +1591,7 @@ int writeResolvConf(struct networkDeviceConfig * net) { f = fopen(filename, "w"); if (!f) { - logMessage(ERROR, "Cannot create %s: %s\n", filename, strerror(errno)); + logMessage(ERROR, "Cannot create %s: %m\n", filename); return LOADER_ERROR; } diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c index 68568d9a6..6c5dfefe6 100644 --- a/loader2/nfsinstall.c +++ b/loader2/nfsinstall.c @@ -62,7 +62,7 @@ int nfsGetSetup(char ** hostptr, char ** dirptr) { if (asprintf(&entries[1].text, _("%s directory:"), getProductName()) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -73,7 +73,7 @@ int nfsGetSetup(char ** hostptr, char ** dirptr) { if (asprintf(&buf, _("Please enter the server name and path to your %s " "images."), getProductName()) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -125,8 +125,7 @@ char * mountNfsImage(struct installMethod * method, if (asprintf(&mountOpts, "ro,%s", ((struct nfsInstallData *) loaderData->stage2Data)->mountOpts) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -159,8 +158,7 @@ char * mountNfsImage(struct installMethod * method, if (!substr || (substr && *(substr+4) != '\0')) { if (asprintf(&directory, "%s/images/%s", directory, stage2img) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -185,8 +183,7 @@ char * mountNfsImage(struct installMethod * method, if (asprintf(&fullPath, "%s:%.*s", host, (int) (strrchr(directory, '/')-directory), directory) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -202,8 +199,7 @@ char * mountNfsImage(struct installMethod * method, if (!doPwMount(fullPath, "/mnt/stage2", "nfs", mountOpts)) { if (asprintf(&buf, "/mnt/stage2/%s", strrchr(directory, '/')) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -216,8 +212,8 @@ char * mountNfsImage(struct installMethod * method, if (asprintf(&url, "nfs:%s:%s", host, directory) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, - __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, + __LINE__); abort(); } @@ -246,8 +242,7 @@ char * mountNfsImage(struct installMethod * method, if (asprintf(&buf, _("That directory does not seem to " "contain a %s installation tree."), getProductName()) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -266,8 +261,7 @@ char * mountNfsImage(struct installMethod * method, if (asprintf(&buf, "%.*s/RHupdates", (int) (strrchr(fullPath, '/')-fullPath), fullPath) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -370,8 +364,7 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) { inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); if (asprintf(&url, "%s:%s", ret, "/kickstart/") == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -380,8 +373,7 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) { inet_ntop(tip->sa_family, IP_ADDR(tip), ret, IP_STRLEN(tip)); if (asprintf(&url, "%s:%s", ret, netCfg.dev.bootFile) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -419,14 +411,12 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) { if (*chk == '/' || *path == '/') { if (asprintf(&host, "%s%s", host, path) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } else { if (asprintf(&host, "%s/%s", host, path) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -438,8 +428,7 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) { char * buf; if (asprintf(&buf, "/tmp/mnt/%s", file) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/selinux.c b/loader2/selinux.c index e0e9e93af..b565a1207 100644 --- a/loader2/selinux.c +++ b/loader2/selinux.c @@ -43,7 +43,7 @@ int loadpolicy() { setenv("LD_LIBRARY_PATH", LIBPATH, 1); execl("/usr/sbin/load_policy", "/usr/sbin/load_policy", "-q", NULL); - logMessage(ERROR, "exec of load_policy failed: %s", strerror(errno)); + logMessage(ERROR, "exec of load_policy failed: %m"); exit(1); } diff --git a/loader2/telnetd.c b/loader2/telnetd.c index d5850f4af..f262362e8 100644 --- a/loader2/telnetd.c +++ b/loader2/telnetd.c @@ -68,7 +68,7 @@ int beTelnet(void) { struct winsize ws; if ((sock = socket(PF_INET, SOCK_STREAM, 0)) < 0) { - logMessage(ERROR, "socket: %s", strerror(errno)); + logMessage(ERROR, "socket: %m"); return -1; } @@ -90,8 +90,7 @@ int beTelnet(void) { if ((conn = accept(sock, (struct sockaddr *) &address, &addrLength)) < 0) { - newtWinMessage(_("Error"), _("OK"), "accept failed: %s", - strerror(errno)); + newtWinMessage(_("Error"), _("OK"), "accept failed: %m"); close(sock); return -1; } @@ -196,9 +195,8 @@ int beTelnet(void) { } - if (i < 0) { - logMessage(ERROR, "poll: %s", strerror(errno)); - } + if (i < 0) + logMessage(ERROR, "poll: %m"); #ifndef DEBUG_TELNET stopNewt(); diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c index a16a4e87a..4090c5e48 100644 --- a/loader2/urlinstall.c +++ b/loader2/urlinstall.c @@ -65,8 +65,7 @@ static int loadSingleUrlImage(struct iurlinfo * ui, char *path, "X-Anaconda-Architecture: %s\r\n" "X-Anaconda-System-Release: %s\r\n", VERSION, arch, name) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -122,8 +121,7 @@ static int loadUrlImages(struct iurlinfo * ui) { /* grab the updates.img before stage2.img so that we minimize our * ramdisk usage */ if (asprintf(&buf, "%s/%s", path, "updates.img") == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -145,8 +143,7 @@ static int loadUrlImages(struct iurlinfo * ui) { /* grab the product.img before stage2.img so that we minimize our * ramdisk usage */ if (asprintf(&buf, "%s/%s", path, "product.img") == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -163,8 +160,7 @@ static int loadUrlImages(struct iurlinfo * ui) { free(buf); if (asprintf(&dest, "/tmp/stage2.img") == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } @@ -243,8 +239,8 @@ char *mountUrlImage(struct installMethod *method, char *location, if (asprintf(&ui.prefix, "%s/images/%s", ui.prefix, stage2img) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, - __LINE__, strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, + __LINE__); abort(); } } @@ -336,8 +332,7 @@ int getFileFromUrl(char * url, char * dest, "X-Anaconda-Architecture: %s\r\n" "X-Anaconda-System-Release: %s\r\n", VERSION, arch, name) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -356,8 +351,7 @@ int getFileFromUrl(char * url, char * dest, if (mac) { if (asprintf(&tmpstr, "X-RHN-Provisioning-MAC-%d: %s %s\r\n", i, dev, mac) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } diff --git a/loader2/urls.c b/loader2/urls.c index 1f9a55e62..9c9f2cb75 100644 --- a/loader2/urls.c +++ b/loader2/urls.c @@ -185,8 +185,7 @@ int urlinstStartTransfer(struct iurlinfo * ui, char *path, if ((errno == ERANGE && (port == LONG_MIN || port == LONG_MAX)) || (errno != 0 && port == 0)) { - logMessage(ERROR, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(ERROR, "%s: %d: %m", __func__, __LINE__); abort(); } } @@ -287,8 +286,7 @@ int urlMainSetupPanel(struct iurlinfo * ui) { if (asprintf(&buf, _("Please enter the URL containing the %s images on your server."), getProductName()) == -1) { - logMessage(CRITICAL, "%s: %d: %s", __func__, __LINE__, - strerror(errno)); + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); abort(); } |