chiark / gitweb /
networkd: send hostname to dhcp server
[elogind.git] / src / shared / util.c
index 1709bb70ca3ab332894965d5034daea95de1319e..9b5a47ab6fb6d3735937945c156d7a526171adfe 100644 (file)
@@ -282,11 +282,11 @@ int parse_uid(const char *s, uid_t* ret_uid) {
 
         /* Some libc APIs use (uid_t) -1 as special placeholder */
         if (uid == (uid_t) 0xFFFFFFFF)
-                return -EINVAL;
+                return -ENXIO;
 
-        /* A long time ago UIDs where 16bit, hence explicitly avoid the 32bit -1 too */
+        /* A long time ago UIDs where 16bit, hence explicitly avoid the 16bit -1 too */
         if (uid == (uid_t) 0xFFFF)
-                return -EINVAL;
+                return -ENXIO;
 
         *ret_uid = uid;
         return 0;
@@ -3482,6 +3482,17 @@ int wait_for_terminate(pid_t pid, siginfo_t *status) {
         }
 }
 
+/*
+ * Return values:
+ * < 0 : wait_for_terminate() failed to get the state of the
+ *       process, the process was terminated by a signal, or
+ *       failed for an unknown reason.
+ * >=0 : The process terminated normally, and its exit code is
+ *       returned.
+ *
+ * That is, success is indicated by a return value of zero, and an
+ * error is indicated by a non-zero value.
+ */
 int wait_for_terminate_and_warn(const char *name, pid_t pid) {
         int r;
         siginfo_t status;