core: pass the correct error to the caller

This commit is contained in:
Lennart Poettering
2017-10-02 17:41:44 +02:00
parent da50b85af7
commit e53c42ca0a
+2 -1
View 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);