Browse Source

[LibOS] Remove abused goto in shim_init()

Isaku Yamahata 6 years ago
parent
commit
22bc3c2f49
1 changed files with 1 additions and 3 deletions
  1. 1 3
      LibOS/shim/src/shim_init.c

+ 1 - 3
LibOS/shim/src/shim_init.c

@@ -724,11 +724,10 @@ noreturn void* shim_init (int argc, void * args)
             RUN_INIT(init_mount_root);
             RUN_INIT(init_mount_root);
             RUN_INIT(init_from_checkpoint_file, filename, &hdr.checkpoint,
             RUN_INIT(init_from_checkpoint_file, filename, &hdr.checkpoint,
                      &cpaddr);
                      &cpaddr);
-            goto restore;
         }
         }
     }
     }
 
 
-    if (PAL_CB(parent_process)) {
+    if (!cpaddr && PAL_CB(parent_process)) {
         RUN_INIT(init_newproc, &hdr);
         RUN_INIT(init_newproc, &hdr);
         SAVE_PROFILE_INTERVAL_SET(child_created_in_new_process,
         SAVE_PROFILE_INTERVAL_SET(child_created_in_new_process,
                                   hdr.create_time, begin_time);
                                   hdr.create_time, begin_time);
@@ -741,7 +740,6 @@ noreturn void* shim_init (int argc, void * args)
     }
     }
 
 
     if (cpaddr) {
     if (cpaddr) {
-restore:
         thread_start_event = DkNotificationEventCreate(PAL_FALSE);
         thread_start_event = DkNotificationEventCreate(PAL_FALSE);
         RUN_INIT(restore_checkpoint,
         RUN_INIT(restore_checkpoint,
                  &hdr.checkpoint.hdr, &hdr.checkpoint.mem,
                  &hdr.checkpoint.hdr, &hdr.checkpoint.mem,