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 (from parent 1:
8baaf7a
)
nspawn: simplify exit condition check
author
Lennart Poettering
<lennart@poettering.net>
Mon, 30 Jun 2014 13:19:00 +0000
(15:19 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 30 Jun 2014 13:19:00 +0000
(15:19 +0200)
src/nspawn/nspawn.c
patch
|
blob
|
history
diff --git
a/src/nspawn/nspawn.c
b/src/nspawn/nspawn.c
index 8fb72d6d3632efd2a3a2f1c35db1f9e37b6df52b..a00a220966ae477c6caaf9cae2ffd2bd680083e7 100644
(file)
--- a/
src/nspawn/nspawn.c
+++ b/
src/nspawn/nspawn.c
@@
-3309,14
+3309,15
@@
check_container_status:
r = wait_for_container(pid, &container_status);
pid = 0;
r = wait_for_container(pid, &container_status);
pid = 0;
- if (r != 0) {
- /* If r < 0, explicitly set to EXIT_FAILURE,
- * otherwise return the exit code of the
- * containered process. */
- if (r < 0)
- r = EXIT_FAILURE;
+ if (r < 0) {
+ /* We failed to wait for the container, or the
+ * container exited abnormally */
+ r = EXIT_FAILURE;
break;
break;
- } else if (container_status == CONTAINER_TERMINATED)
+ } else if (r > 0 || container_status == CONTAINER_TERMINATED)
+ /* The container exited with a non-zero
+ * status, or with zero status and no reboot
+ * was requested. */
break;
/* CONTAINER_REBOOTED, loop again */
break;
/* CONTAINER_REBOOTED, loop again */