chiark / gitweb /
Add a snprinf wrapper which checks that the buffer was big enough
[elogind.git] / src / core / socket.c
index 828ed31077c322b22881bb9fd2dee4e0e117d0f5..85f7f16e15360cbe4dcefc49948c9882652d1553 100644 (file)
@@ -48,6 +48,7 @@
 #include "smack-util.h"
 #include "bus-util.h"
 #include "bus-error.h"
+#include "selinux-util.h"
 #include "dbus-socket.h"
 #include "unit.h"
 #include "socket.h"
@@ -1456,8 +1457,8 @@ static int socket_chown(Socket *s, pid_t *_pid) {
 
         if (pid == 0) {
                 SocketPort *p;
-                uid_t uid = (uid_t) -1;
-                gid_t gid = (gid_t) -1;
+                uid_t uid = UID_INVALID;
+                gid_t gid = GID_INVALID;
                 int ret;
 
                 default_signals(SIGNALS_CRASH_HANDLER, SIGNALS_IGNORE, -1);
@@ -1953,7 +1954,7 @@ static int socket_start(Unit *u) {
         s->result = SOCKET_SUCCESS;
         socket_enter_start_pre(s);
 
-        return 0;
+        return 1;
 }
 
 static int socket_stop(Unit *u) {
@@ -1984,7 +1985,7 @@ static int socket_stop(Unit *u) {
         assert(s->state == SOCKET_LISTENING || s->state == SOCKET_RUNNING);
 
         socket_enter_stop_pre(s, SOCKET_SUCCESS);
-        return 0;
+        return 1;
 }
 
 static int socket_serialize(Unit *u, FILE *f, FDSet *fds) {