Paul Sajna 7 лет назад
Родитель
Сommit
c568ca2932
1 измененных файлов с 8 добавлено и 7 удалено
  1. 8 7
      tests/waitpid.c

+ 8 - 7
tests/waitpid.c

@@ -5,12 +5,13 @@
 int main(int argc, char** argv) {
     pid_t pid = fork();
     if (pid == 0) {
-    // child
-    sleep(1);
-    exit(0);
-} else {
-    // parent
-    int stat_loc;
-    waitpid(pid, &stat_loc, 0);
+        // child
+        sleep(1);
+        exit(0);
+    } else {
+        // parent
+        int stat_loc;
+        waitpid(pid, &stat_loc, 0);
     }
+    return 0;
 }