chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
condition: unify condition logic in one file
[elogind.git]
/
src
/
core
/
shutdown.c
diff --git
a/src/core/shutdown.c
b/src/core/shutdown.c
index 1e88b057903e11630a9fe390e602111748915f72..20cf526ba2716b34fe1a2fc9bde05a396b160502 100644
(file)
--- a/
src/core/shutdown.c
+++ b/
src/core/shutdown.c
@@
-207,7
+207,7
@@
int main(int argc, char *argv[]) {
in_container = detect_container(NULL) > 0;
in_container = detect_container(NULL) > 0;
- need_umount =
true
;
+ need_umount =
!in_container
;
need_swapoff = !in_container;
need_loop_detach = !in_container;
need_dm_detach = !in_container;
need_swapoff = !in_container;
need_loop_detach = !in_container;
need_dm_detach = !in_container;
@@
-313,7
+313,7
@@
int main(int argc, char *argv[]) {
access("/run/initramfs/shutdown", X_OK) == 0) {
r = switch_root_initramfs();
if (r >= 0) {
access("/run/initramfs/shutdown", X_OK) == 0) {
r = switch_root_initramfs();
if (r >= 0) {
- arg
uments
[0] = (char*) "/shutdown";
+ arg
v
[0] = (char*) "/shutdown";
setsid();
make_console_stdio();
setsid();
make_console_stdio();
@@
-321,7
+321,7
@@
int main(int argc, char *argv[]) {
log_info("Successfully changed into root pivot.\n"
"Returning to initrd...");
log_info("Successfully changed into root pivot.\n"
"Returning to initrd...");
- execv("/shutdown", arg
uments
);
+ execv("/shutdown", arg
v
);
log_error("Failed to execute shutdown binary: %m");
} else
log_error("Failed to switch root to \"/run/initramfs\": %s", strerror(-r));
log_error("Failed to execute shutdown binary: %m");
} else
log_error("Failed to switch root to \"/run/initramfs\": %s", strerror(-r));