From 0334f84d7012e2930aa3d735e3c95f156bb3a679 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 26 Nov 2014 21:40:17 +0000 Subject: Simplify the mparse_open()/mparse_wait() interface. Don't bother the user with the PID of the child process, store it inside the opaque mparse handle. --- mandocdb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mandocdb.c') diff --git a/mandocdb.c b/mandocdb.c index 7d9caf23..7377d847 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.169 2014/11/19 20:40:51 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.170 2014/11/26 21:40:17 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -1084,7 +1084,6 @@ mpages_merge(struct mchars *mc, struct mparse *mp) struct man *man; char *sodest; char *cp; - pid_t child_pid; int fd; unsigned int pslot; enum mandoclevel lvl; @@ -1112,9 +1111,8 @@ mpages_merge(struct mchars *mc, struct mparse *mp) mdoc = NULL; man = NULL; sodest = NULL; - child_pid = 0; - mparse_open(mp, &fd, mpage->mlinks->file, &child_pid); + mparse_open(mp, &fd, mpage->mlinks->file); if (fd == -1) { say(mpage->mlinks->file, "&open"); goto nextpage; @@ -1231,8 +1229,7 @@ mpages_merge(struct mchars *mc, struct mparse *mp) dbadd(mpage, mc); nextpage: - if (child_pid && - mparse_wait(mp, child_pid) != MANDOCLEVEL_OK) { + if (mparse_wait(mp) != MANDOCLEVEL_OK) { exitcode = (int)MANDOCLEVEL_SYSERR; say(mpage->mlinks->file, "&wait gunzip"); } -- cgit v1.2.3-56-ge451