mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
Replace %m GNUism with strerror(errno)
Even musl libc supports %m today, as well as most syslog daemons, but that's no excuse to use this. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -141,7 +141,7 @@ static void rtc_restore(void *arg)
|
||||
else if (ENOENT == errno)
|
||||
logit(LOG_ERR, "RTC has no previously saved (valid) time.");
|
||||
else
|
||||
logit(LOG_ERR, "RTC error code %d: %m", errno);
|
||||
logit(LOG_ERR, "RTC error code %d: %s", errno, strerror(errno));
|
||||
rc = 2;
|
||||
goto out;
|
||||
}
|
||||
|
||||
+2
-2
@@ -249,7 +249,7 @@ static void prepare_tty(char *tty, speed_t speed, char *procname, struct rlimit
|
||||
|
||||
fd = open(tty, O_RDWR);
|
||||
if (fd < 0) {
|
||||
logit(LOG_ERR, "Failed opening %s: %m", tty);
|
||||
logit(LOG_ERR, "Failed opening %s: %s", tty, strerror(errno));
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ static void prepare_tty(char *tty, speed_t speed, char *procname, struct rlimit
|
||||
close(fd);
|
||||
|
||||
if (ioctl(STDIN_FILENO, TIOCSCTTY, 1) < 0)
|
||||
logit(LOG_WARNING, "Failed TIOCSCTTY on %s: %m", tty);
|
||||
logit(LOG_WARNING, "Failed TIOCSCTTY on %s: %s", tty, strerror(errno));
|
||||
|
||||
/*
|
||||
* Reset to sane defaults in case of messup from prev. session
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ static void socket_cb(uev_t *w, void *arg, int events)
|
||||
|
||||
_d("%s: Got socket event ...", svc->cmd);
|
||||
if (UEV_ERROR == events) {
|
||||
logit(LOG_INFO, "%s: Socket error, aborting: %m", svc->cmd);
|
||||
logit(LOG_INFO, "%s: Socket error, aborting: %s", svc->cmd, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define _d(fmt, args...) logit(LOG_DEBUG, "%s():" fmt "\n", __func__, ##args)
|
||||
#define _w(fmt, args...) logit(LOG_WARNING, "%s():" fmt "\n", __func__, ##args)
|
||||
#define _e(fmt, args...) logit(LOG_ERR, "%s():" fmt "\n", __func__, ##args)
|
||||
#define _pe(fmt, args...) logit(LOG_ERR, "%s():" fmt ": %m\n", __func__, ##args)
|
||||
#define _pe(fmt, args...) logit(LOG_ERR, "%s():" fmt ": %s\n", __func__, ##args, strerror(errno))
|
||||
|
||||
void log_init (int dbg);
|
||||
void log_exit (void);
|
||||
|
||||
Reference in New Issue
Block a user