diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-26 21:40:17 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-26 21:40:17 +0000 |
commit | a7d7f08f9bf1378002063e44fe9ce8a27a886eed (patch) | |
tree | 0634189e33baee57f5507e69c97479bb570c25f6 /main.c | |
parent | 3270470c52b9d9f79faaba63eabc57ed8bfbb776 (diff) | |
download | mandoc-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.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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) |