aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit0334f84d7012e2930aa3d735e3c95f156bb3a679 (patch)
tree3e73211ed643468e16f996cb81015f698177c744 /main.c
parent6b21541c4f687461a2efa734f27f3451da3030f8 (diff)
downloadmandoc-0334f84d7012e2930aa3d735e3c95f156bb3a679.tar.gz
mandoc-0334f84d7012e2930aa3d735e3c95f156bb3a679.tar.zst
mandoc-0334f84d7012e2930aa3d735e3c95f156bb3a679.zip
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.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/main.c b/main.c
index 63ac45e8..34784994 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.199 2014/11/11 19:04:55 schwarze Exp $ */
+/* $Id: main.c,v 1.200 2014/11/26 21:40:17 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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)