chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mount: check options as well as fstype for network mounts
[elogind.git]
/
src
/
login
/
logind-user.c
diff --git
a/src/login/logind-user.c
b/src/login/logind-user.c
index 7a39140d88b8c7e47fef1e1c518c5768cf7dd41a..9ff1302663e0ebeaa31edafe904eb11df3ab8566 100644
(file)
--- a/
src/login/logind-user.c
+++ b/
src/login/logind-user.c
@@
-252,7
+252,7
@@
int user_save(User *u) {
finish:
if (r < 0)
finish:
if (r < 0)
- log_error_errno(
-
r, "Failed to save user data %s: %m", u->state_file);
+ log_error_errno(r, "Failed to save user data %s: %m", u->state_file);
return r;
}
return r;
}
@@
-278,7
+278,7
@@
int user_load(User *u) {
if (r == -ENOENT)
return 0;
if (r == -ENOENT)
return 0;
- log_error_errno(
-
r, "Failed to read %s: %m", u->state_file);
+ log_error_errno(r, "Failed to read %s: %m", u->state_file);
return r;
}
return r;
}
@@
-310,10
+310,8
@@
static int user_mkdir_runtime_path(User *u) {
assert(u);
r = mkdir_safe_label("/run/user", 0755, 0, 0);
assert(u);
r = mkdir_safe_label("/run/user", 0755, 0, 0);
- if (r < 0) {
- log_error_errno(-r, "Failed to create /run/user: %m");
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to create /run/user: %m");
if (!u->runtime_path) {
if (asprintf(&p, "/run/user/" UID_FMT, u->uid) < 0)
if (!u->runtime_path) {
if (asprintf(&p, "/run/user/" UID_FMT, u->uid) < 0)
@@
-338,7
+336,7
@@
static int user_mkdir_runtime_path(User *u) {
r = mount("tmpfs", p, "tmpfs", MS_NODEV|MS_NOSUID, t);
if (r < 0) {
r = mount("tmpfs", p, "tmpfs", MS_NODEV|MS_NOSUID, t);
if (r < 0) {
- log_error_errno(
-
r, "Failed to mount per-user tmpfs directory %s: %m", p);
+ log_error_errno(r, "Failed to mount per-user tmpfs directory %s: %m", p);
goto fail;
}
}
goto fail;
}
}
@@
-510,14
+508,14
@@
static int user_remove_runtime_path(User *u) {
r = rm_rf(u->runtime_path, false, false, false);
if (r < 0)
r = rm_rf(u->runtime_path, false, false, false);
if (r < 0)
- log_error_errno(
-
r, "Failed to remove runtime directory %s: %m", u->runtime_path);
+ log_error_errno(r, "Failed to remove runtime directory %s: %m", u->runtime_path);
if (umount2(u->runtime_path, MNT_DETACH) < 0)
if (umount2(u->runtime_path, MNT_DETACH) < 0)
- log_error
(
"Failed to unmount user runtime directory %s: %m", u->runtime_path);
+ log_error
_errno(errno,
"Failed to unmount user runtime directory %s: %m", u->runtime_path);
r = rm_rf(u->runtime_path, false, true, false);
if (r < 0)
r = rm_rf(u->runtime_path, false, true, false);
if (r < 0)
- log_error_errno(
-
r, "Failed to remove runtime directory %s: %m", u->runtime_path);
+ log_error_errno(r, "Failed to remove runtime directory %s: %m", u->runtime_path);
free(u->runtime_path);
u->runtime_path = NULL;
free(u->runtime_path);
u->runtime_path = NULL;