static int make_userns(uid_t stored_uid, uid_t exposed_uid) {
_cleanup_free_ char *text = NULL;
- _cleanup_close_ int userns_fd = -1;
+ _cleanup_close_ int userns_fd = -EBADF;
int r;
assert(uid_is_valid(stored_uid));
}
int home_shift_uid(int dir_fd, const char *target, uid_t stored_uid, uid_t exposed_uid, int *ret_mount_fd) {
- _cleanup_close_ int mount_fd = -1, userns_fd = -1;
+ _cleanup_close_ int mount_fd = -EBADF, userns_fd = -EBADF;
int r;
assert(dir_fd >= 0);
log_debug_errno(errno, "The open_tree() syscall is not supported, not setting up UID shift mount: %m");
if (ret_mount_fd)
- *ret_mount_fd = -1;
+ *ret_mount_fd = -EBADF;
return 0;
}
log_debug_errno(errno, "UID/GID mapping for shifted mount not available, not setting it up: %m");
if (ret_mount_fd)
- *ret_mount_fd = -1;
+ *ret_mount_fd = -EBADF;
return 0;
}