core: pass the correct error to the caller
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Sep 2017 18:33:38 +0000 (20:33 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 2 Oct 2017 15:41:44 +0000 (17:41 +0200)
src/core/dynamic-user.c

index 11d9a3c..66e83a7 100644 (file)
@@ -306,8 +306,9 @@ static int pick_uid(char **suggested_paths, const char *name, uid_t *ret_uid) {
                                     IOVEC_INIT((char[1]) { '\n' }, 1),
                             }, 2, 0);
                 if (l < 0) {
+                        r = -errno;
                         (void) unlink(lock_path);
-                        return -errno;
+                        return r;
                 }
 
                 (void) ftruncate(lock_fd, l);