chiark / gitweb /
service: don't accept negative ERRNO= notification messages
[elogind.git] / src / core / socket.c
index 9c4943e0bfd15cbc237302f4d2056e112f672bdf..c58a7f03ee9336260a7b2a884cb5547edf9d0a2e 100644 (file)
@@ -209,13 +209,6 @@ static int socket_instantiate_service(Socket *s) {
         if (r < 0)
                 return r;
 
-#ifdef HAVE_SYSV_COMPAT
-        if (SERVICE(u)->is_sysv) {
-                log_error("Using SysV services for socket activation is not supported. Refusing.");
-                return -ENOENT;
-        }
-#endif
-
         u->no_gc = true;
         unit_ref_set(&s->service, u);
 
@@ -1350,6 +1343,8 @@ static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
                        NULL,
                        s->exec_runtime,
                        &pid);
+        if (r < 0)
+                goto fail;
 
         r = unit_watch_pid(UNIT(s), pid);
         if (r < 0)
@@ -1410,7 +1405,7 @@ static int socket_chown(Socket *s, pid_t *_pid) {
                 }
 
                 LIST_FOREACH(port, p, s->ports) {
-                        const char *path;
+                        const char *path = NULL;
 
                         if (p->type == SOCKET_SOCKET)
                                 path = socket_address_get_path(&p->address);
@@ -1870,13 +1865,6 @@ static int socket_start(Unit *u) {
                         log_error_unit(u->id, "Socket service %s already active, refusing.", UNIT(service)->id);
                         return -EBUSY;
                 }
-
-#ifdef HAVE_SYSV_COMPAT
-                if (service->is_sysv) {
-                        log_error_unit(u->id, "Using SysV services for socket activation is not supported. Refusing.");
-                        return -ENOENT;
-                }
-#endif
         }
 
         assert(s->state == SOCKET_DEAD || s->state == SOCKET_FAILED);