chiark / gitweb /
nspawn: inherit the exit status of container
authorDave Reisner <dreisner@archlinux.org>
Thu, 2 May 2013 14:39:53 +0000 (10:39 -0400)
committerDave Reisner <dreisner@archlinux.org>
Thu, 2 May 2013 14:41:03 +0000 (10:41 -0400)
If we get as far as successfully starting the container, nspawn should
inherit the exit status of the child container process as its own.

src/nspawn/nspawn.c

index bbb3334..e907a1d 100644 (file)
@@ -1696,9 +1696,9 @@ int main(int argc, char *argv[]) {
                 }
 
                 if (status.si_code == CLD_EXITED) {
+                        r = status.si_status;
                         if (status.si_status != 0) {
                                 log_error("Container failed with error code %i.", status.si_status);
-                                r = status.si_status;
                                 break;
                         }