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. --- main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'main.c') 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 * Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze @@ -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) -- cgit v1.2.3-56-ge451