summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-26 21:40:17 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-26 21:40:17 +0000
commita7d7f08f9bf1378002063e44fe9ce8a27a886eed (patch)
tree0634189e33baee57f5507e69c97479bb570c25f6 /main.c
parent3270470c52b9d9f79faaba63eabc57ed8bfbb776 (diff)
downloadmandoc-a7d7f08f9bf1378002063e44fe9ce8a27a886eed.tar.gz
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.
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/main.c b/main.c
index 6928e294..e6afc274 100644
--- a/main.c
+++ b/main.c
@@ -115,7 +115,6 @@ main(int argc, char *argv[])
#endif
enum mandoclevel rc;
enum outmode outmode;
- pid_t child_pid;
int fd;
int show_usage;
int use_pager;
@@ -388,8 +387,7 @@ main(int argc, char *argv[])
while (argc) {
#if HAVE_SQLITE3
if (resp != NULL) {
- rc = mparse_open(curp.mp, &fd, resp->file,
- &child_pid);
+ rc = mparse_open(curp.mp, &fd, resp->file);
if (fd == -1)
/* nothing */;
else if (resp->form & FORM_SRC) {
@@ -403,14 +401,12 @@ main(int argc, char *argv[])
} else
#endif
{
- rc = mparse_open(curp.mp, &fd, *argv++,
- &child_pid);
+ rc = mparse_open(curp.mp, &fd, *argv++);
if (fd != -1)
parse(&curp, fd, argv[-1], &rc);
}
- if (child_pid &&
- mparse_wait(curp.mp, child_pid) != MANDOCLEVEL_OK)
+ if (mparse_wait(curp.mp) != MANDOCLEVEL_OK)
rc = MANDOCLEVEL_SYSERR;
if (MANDOCLEVEL_OK != rc && curp.wstop)