Use error_msg instead of fprintf(stderr
This commit is contained in:
parent
d7d5f42934
commit
efdd0aed23
@ -230,7 +230,7 @@ static void message(int device, char *fmt, ...)
|
|||||||
if (log_fd < 0) {
|
if (log_fd < 0) {
|
||||||
if ((log_fd = device_open(log, O_RDWR | O_NDELAY)) < 0) {
|
if ((log_fd = device_open(log, O_RDWR | O_NDELAY)) < 0) {
|
||||||
log_fd = -2;
|
log_fd = -2;
|
||||||
fprintf(stderr, "Bummer, can't write to log on %s!\n", log);
|
error_msg("Bummer, can't write to log on %s!", log);
|
||||||
device = CONSOLE;
|
device = CONSOLE;
|
||||||
} else {
|
} else {
|
||||||
fcntl(log_fd, F_SETFD, FD_CLOEXEC);
|
fcntl(log_fd, F_SETFD, FD_CLOEXEC);
|
||||||
@ -253,7 +253,7 @@ static void message(int device, char *fmt, ...)
|
|||||||
va_end(arguments);
|
va_end(arguments);
|
||||||
close(fd);
|
close(fd);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Bummer, can't print: ");
|
error_msg("Bummer, can't print: ");
|
||||||
va_start(arguments, fmt);
|
va_start(arguments, fmt);
|
||||||
vfprintf(stderr, fmt, arguments);
|
vfprintf(stderr, fmt, arguments);
|
||||||
va_end(arguments);
|
va_end(arguments);
|
||||||
|
Loading…
Reference in New Issue
Block a user