mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
log: properly open log target in the various utilities
This commit is contained in:
parent
618e02c7b7
commit
2396fb04f7
@ -75,6 +75,7 @@ int main(int argc, char *argv[]) {
|
||||
int r = 0, retval = 1;
|
||||
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
if ((r = parse_argv(argc, argv)) < 0)
|
||||
goto finish;
|
||||
|
@ -39,6 +39,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
/* If possible we go via the system bus, to make sure that
|
||||
* session instances get the messages. If not possible we talk
|
||||
|
@ -349,6 +349,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
if ((n = sd_listen_fds(true)) < 0) {
|
||||
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
|
||||
|
@ -73,7 +73,7 @@ static int log_open_console(void) {
|
||||
return console_fd;
|
||||
}
|
||||
|
||||
log_info("Succesfully opened /dev/console for logging.");
|
||||
log_debug("Succesfully opened /dev/console for logging.");
|
||||
} else
|
||||
console_fd = STDERR_FILENO;
|
||||
|
||||
@ -99,7 +99,7 @@ static int log_open_kmsg(void) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
log_info("Succesfully opened /dev/kmsg for logging.");
|
||||
log_debug("Succesfully opened /dev/kmsg for logging.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -146,7 +146,7 @@ static int log_open_syslog(void) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
log_info("Succesfully opened syslog for logging.");
|
||||
log_debug("Succesfully opened syslog for logging.");
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -547,6 +547,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
if ((n = sd_listen_fds(true)) < 0) {
|
||||
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
|
||||
|
@ -134,6 +134,7 @@ int main(int argc, char* argv[]) {
|
||||
int r, retval = 1;
|
||||
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
if ((r = parse_argv(argc, argv)) <= 0) {
|
||||
retval = r < 0;
|
||||
|
@ -39,7 +39,9 @@ int main(int argc, char *argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
/* When we load the seed we read it and write it to the device
|
||||
* and then immediately update the saved seed with new data,
|
||||
|
@ -192,6 +192,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
if ((n_fds = sd_listen_fds(true)) < 0) {
|
||||
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
|
||||
|
@ -4903,6 +4903,7 @@ int main(int argc, char*argv[]) {
|
||||
dbus_error_init(&error);
|
||||
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
if ((r = parse_argv(argc, argv)) < 0)
|
||||
goto finish;
|
||||
|
@ -368,6 +368,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
|
||||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
#ifdef HAVE_AUDIT
|
||||
if ((c.audit_fd = audit_open()) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user