Skip to content

Commit 8e901fe

Browse files
poetteringbluca
authored andcommitted
homed: generate proper error if we cannot create mountpoint for homedir
Let's make this easier to debug. (When this failed for me due to disk full it took me a bit to figure out what was going on.) (cherry picked from commit 5b759bf) (cherry picked from commit 8158c87c36d5725818a2a9cda4270b8839553f86) (cherry picked from commit 6d33cf046a2064dd11ca9a1ee6d8f2d2356f4f10) (cherry picked from commit 756d41d)
1 parent f278684 commit 8e901fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/home/homework-mount.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ int home_move_mount(const char *mount_suffix, const char *target) {
142142
} else
143143
d = HOME_RUNTIME_WORK_DIR;
144144

145-
(void) mkdir_p(target, 0700);
145+
r = mkdir_p(target, 0700);
146+
if (r < 0)
147+
return log_error_errno(r, "Failed to create directory '%s': %m", target);
146148

147149
r = mount_nofollow_verbose(LOG_ERR, d, target, NULL, MS_BIND, NULL);
148150
if (r < 0)

0 commit comments

Comments
 (0)