chiark / gitweb /
gcc: make gcc shut up
[elogind.git] / src / socket.c
index 6ec49de4664375fa26697ff655e05a8bcc3cba57..4443dba0c991b46a51cbd9140d26119127d0ac5c 100644 (file)
@@ -41,6 +41,7 @@
 #include "special.h"
 #include "bus-errors.h"
 #include "label.h"
+#include "exit-status.h"
 
 static const UnitActiveState state_translation_table[_SOCKET_STATE_MAX] = {
         [SOCKET_DEAD] = UNIT_INACTIVE,
@@ -759,8 +760,9 @@ static int socket_open_fds(Socket *s) {
                                 if ((r = socket_instantiate_service(s)) < 0)
                                         return r;
 
-                                if ((r = label_get_socket_label_from_exe(s->service->exec_command[SERVICE_EXEC_START]->path, &label)) < 0)
-                                        return r;
+                                if (s->service && s->service->exec_command[SERVICE_EXEC_START])
+                                        if ((r = label_get_socket_label_from_exe(s->service->exec_command[SERVICE_EXEC_START]->path, &label)) < 0)
+                                                return r;
 
                                 know_label = true;
                         }
@@ -880,7 +882,7 @@ static void socket_set_state(Socket *s, SocketState state) {
                           socket_state_to_string(old_state),
                           socket_state_to_string(state));
 
-        unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state]);
+        unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], true);
 }
 
 static int socket_coldplug(Unit *u) {