chiark / gitweb /
build-sys: more remaining parts of sd-deamon to their own section in Makefile.am
[elogind.git] / src / manager.c
index 6d202588939a3485bcb37b8c4b862a95c4346123..9957bbf12ac56d26b1a64315f4a739c1600e041e 100644 (file)
@@ -231,7 +231,7 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) {
         dual_timestamp_get(&m->startup_timestamp);
 
         m->running_as = running_as;
-        m->name_data_slot = m->subscribed_data_slot = -1;
+        m->name_data_slot = m->conn_data_slot = m->subscribed_data_slot = -1;
         m->exit_code = _MANAGER_EXIT_CODE_INVALID;
         m->pin_cgroupfs_fd = -1;
 
@@ -286,7 +286,10 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) {
                 goto fail;
 
 #ifdef HAVE_AUDIT
-        if ((m->audit_fd = audit_open()) < 0)
+        if ((m->audit_fd = audit_open()) < 0 &&
+            /* If the kernel lacks netlink or audit support,
+             * don't worry about it. */
+            errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
                 log_error("Failed to connect to audit log: %m");
 #endif
 
@@ -2029,7 +2032,7 @@ static int manager_dispatch_sigchld(Manager *m) {
                 if (si.si_code == CLD_EXITED || si.si_code == CLD_KILLED || si.si_code == CLD_DUMPED) {
                         char *name = NULL;
 
-                        get_process_name(si.si_pid, &name);
+                        get_process_comm(si.si_pid, &name);
                         log_debug("Got SIGCHLD for process %lu (%s)", (unsigned long) si.si_pid, strna(name));
                         free(name);
                 }
@@ -2114,7 +2117,7 @@ static int manager_process_signal_fd(Manager *m) {
                 if (sfsi.ssi_pid > 0) {
                         char *p = NULL;
 
-                        get_process_name(sfsi.ssi_pid, &p);
+                        get_process_comm(sfsi.ssi_pid, &p);
 
                         log_debug("Received SIG%s from PID %lu (%s).",
                                   signal_to_string(sfsi.ssi_signo),