From 7a60dd0d5bc268ce860d042d5894825237278550 Mon Sep 17 00:00:00 2001 From: Bill Medland Date: Wed, 26 Sep 2001 23:04:40 +0000 Subject: [PATCH] Prevent calling null functions. --- scheduler/pthread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scheduler/pthread.c b/scheduler/pthread.c index ab473b656d..262ddbac22 100644 --- a/scheduler/pthread.c +++ b/scheduler/pthread.c @@ -150,15 +150,15 @@ pid_t PTHREAD_FORK(void) EnterCriticalSection( &atfork_section ); /* prepare handlers are called in reverse insertion order */ - for (i = atfork_count - 1; i >= 0; i--) atfork_prepare[i](); + for (i = atfork_count - 1; i >= 0; i--) if (atfork_prepare[i]) atfork_prepare[i](); if (!(pid = LIBC_FORK())) { InitializeCriticalSection( &atfork_section ); - for (i = 0; i < atfork_count; i++) atfork_child[i](); + for (i = 0; i < atfork_count; i++) if (atfork_child[i]) atfork_child[i](); } else { - for (i = 0; i < atfork_count; i++) atfork_parent[i](); + for (i = 0; i < atfork_count; i++) if (atfork_parent[i]) atfork_parent[i](); LeaveCriticalSection( &atfork_section ); } return pid;