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 bbb3334ba1a2cfb023f3f9451ddf2030df07e248..e907a1daa7f31549d45bca1747fc4523e3990780 100644 (file)
@@ -1696,9 +1696,9 @@ int main(int argc, char *argv[]) {
                 }
 
                 if (status.si_code == CLD_EXITED) {
                 }
 
                 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);
                         if (status.si_status != 0) {
                                 log_error("Container failed with error code %i.", status.si_status);
-                                r = status.si_status;
                                 break;
                         }
 
                                 break;
                         }