chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4c1d70
)
user-sessions: ignore EROFS when unlinking /etc/nologin if the file doesn't exist...
author
Lennart Poettering
<lennart@poettering.net>
Tue, 10 May 2011 16:55:39 +0000
(18:55 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 10 May 2011 16:55:39 +0000
(18:55 +0200)
src/user-sessions.c
patch
|
blob
|
history
diff --git
a/src/user-sessions.c
b/src/user-sessions.c
index 4518d953ed7bebc80b3f110d2981ee3961391278..e045b88c10d9c67fbee7aee38cfb3f97a54a4399 100644
(file)
--- a/
src/user-sessions.c
+++ b/
src/user-sessions.c
@@
-48,8
+48,16
@@
int main(int argc, char*argv[]) {
}
if (unlink("/etc/nologin") < 0 && errno != ENOENT) {
- log_error("Failed to remove /etc/nologin file: %m");
- q = -errno;
+
+ /* If the file doesn't exist and /etc simply
+ * was read-only (in which case unlink()
+ * returns EROFS even if the file doesn't
+ * exist), don't complain */
+
+ if (errno != EROFS || access("/etc/nologin", F_OK) >= 0) {
+ log_error("Failed to remove /etc/nologin file: %m");
+ q = -errno;
+ }
}
if (r < 0 || q < 0)