aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2017-11-13 12:10:31 +0800
committerIan Kent <raven@themaw.net>2017-12-18 08:46:57 +0800
commita223d11fa8e34239a0de82bb261b50459dd6a8d5 (patch)
treec63b1d262f128e4a82350cd543977284e8117d12 /modules
parentcf2117be803f370590573a28135bd10eb9706f98 (diff)
downloadautofs-a223d11fa8e34239a0de82bb261b50459dd6a8d5.tar.gz
autofs-5.1.3 - serialize calls to open_xxxx() functions
This patch is the second part of the change described in "move open_xxxx() functions to spawn.c" to serialize the open_xxxx() functions wrt. to fork(2). Signed-off-by: Ian Kent <raven@themaw.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/lookup_program.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/lookup_program.c b/modules/lookup_program.c
index b3f1c1f0..56e19394 100644
--- a/modules/lookup_program.c
+++ b/modules/lookup_program.c
@@ -225,6 +225,7 @@ static char *lookup_one(struct autofs_point *ap,
goto out_error;
}
+ open_mutex_lock();
f = fork();
if (f < 0) {
char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
@@ -233,6 +234,7 @@ static char *lookup_one(struct autofs_point *ap,
close(pipefd[1]);
close(epipefd[0]);
close(epipefd[1]);
+ open_mutex_unlock();
goto out_error;
} else if (f == 0) {
reset_signals();
@@ -262,6 +264,7 @@ static char *lookup_one(struct autofs_point *ap,
}
close(pipefd[1]);
close(epipefd[1]);
+ open_mutex_unlock();
mapp = mapent;
errp = errbuf;