diff --git a/CHANGELOG b/CHANGELOG index b11ca75..5bd1af5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -37,6 +37,7 @@ - fix expire regression introduced in the "mitigate manual umount" patch. - still more on multiply recursive bind mounts. - fix tokenizer to distinguish between global option and dn string. +- fix incorrect return from spawn (Gordon Lack). 1/9/2006 autofs-5.0.1 rc2 ------------------------- diff --git a/daemon/spawn.c b/daemon/spawn.c index 579c870..2ede231 100644 --- a/daemon/spawn.c +++ b/daemon/spawn.c @@ -89,7 +89,7 @@ #define ERRBUFSIZ 2047 /* Max length of static int do_spawn(logger *log, unsigned int options, const char *prog, const char *const *argv) { pid_t f; - int status, pipefd[2]; + int ret, status, pipefd[2]; char errbuf[ERRBUFSIZ + 1], *p, *sp; int errp, errn; int cancel_state; @@ -219,8 +219,8 @@ static int do_spawn(logger *log, unsigne log(LOGOPT_ANY, ">> %s", errbuf); } - if (waitpid(f, &status, 0) != f) - status = -1; /* waitpid() failed */ + if (waitpid(f, &ret, 0) != f) + ret = -1; /* waitpid() failed */ if (use_lock) { status = pthread_mutex_unlock(&spawn_mutex); @@ -230,7 +230,7 @@ static int do_spawn(logger *log, unsigne pthread_sigmask(SIG_SETMASK, &oldsig, NULL); pthread_setcancelstate(cancel_state, NULL); - return status; + return ret; } }