There is a race condition in old libc in fork(). The result was that 'end' was sometimes printed twice. This did not happen with glibc-2.32.
Unified · Split
| @@ -116,8 +116,6 @@ main (void) · 115 unmodified lines | |||
| 116 | while (time(NULL) < end) ; | 116 | while (time(NULL) < end) ; |
| 117 | run = 0; | 117 | run = 0; |
| 118 | 118 | ||
| 119 | printf ("end\n"); fflush(stdout); | ||
| 120 | |||
| 121 | pthread_join(id1, NULL); | 119 | pthread_join(id1, NULL); |
| 122 | pthread_join(id2, NULL); | 120 | pthread_join(id2, NULL); |
| 123 | #if !defined(__APPLE__) | 121 | #if !defined(__APPLE__) |
| @@ -126,6 +124,8 @@ main (void) · 2 unmodified lines | |||
| 126 | sem_destroy (&sem); | 124 | sem_destroy (&sem); |
| 127 | sem_destroy (&sem_child); | 125 | sem_destroy (&sem_child); |
| 128 | 126 | ||
| 127 | printf ("end\n"); fflush(stdout); | ||
| 128 | |||
| 129 | sigemptyset (&m); | 129 | sigemptyset (&m); |
| 130 | sigprocmask (SIG_SETMASK, &m, NULL); | 130 | sigprocmask (SIG_SETMASK, &m, NULL); |
| 131 | if (sigsetjmp (sj, 0) == 0) | 131 | if (sigsetjmp (sj, 0) == 0) |