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 | 0334f84d7012e2930aa3d735e3c95f156bb3a679 (patch) | |
tree | 3e73211ed643468e16f996cb81015f698177c744 /mandocdb.c | |
parent | 6b21541c4f687461a2efa734f27f3451da3030f8 (diff) | |
download | mandoc-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 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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 <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -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"); } |