tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Baptiste Daroussin <bapt@FreeBSD.org>
Cc: tech@mdocml.bsd.lv
Subject: Re: [PATCH] Fix "Wait: No Child Process"
Date: Mon, 2 Mar 2015 15:56:33 +0100	[thread overview]
Message-ID: <20150302145633.GA28000@athene.usta.de> (raw)
In-Reply-To: <20150302105519.GO13897@ivaldir.etoilebsd.net>

Hi Baptiste,

Baptiste Daroussin wrote on Mon, Mar 02, 2015 at 11:55:19AM +0100:

> Here is a small patch to fix mandoc complaining about no child process
> when .gz manpages are being read.

Good catch, thanks for reporting!

I committed a tweaked version of the patch such that it also works
correctly if gunzip fails or is killed by a signal.

Yours,
  Ingo


> Index: read.c
> ===================================================================
> RCS file: /cvs/mdocml/read.c,v
> retrieving revision 1.128
> diff -u -r1.128 read.c
> --- read.c	23 Feb 2015 13:31:04 -0000	1.128
> +++ read.c	2 Mar 2015 10:50:12 -0000
> @@ -878,6 +878,7 @@
>  		    "gunzip failed with code %d", WEXITSTATUS(status));
>  		return(MANDOCLEVEL_ERROR);
>  	}
> +	curp->child = 0;
>  	return(MANDOCLEVEL_OK);
>  }
>  


Log Message:
-----------
If a non-gz manual is read after a gzipped manual, refrain 
from throwing a bogus error "wait: No child processes".
As reported by Baptiste Daroussin <bapt at FreeBSD dot org>, 
clearing the state variable curp->child after use was forgotten.

Modified Files:
--------------
    mdocml:
        read.c

Revision Data
-------------
Index: read.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/read.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -Lread.c -Lread.c -u -p -r1.128 -r1.129
--- read.c
+++ read.c
@@ -868,6 +868,7 @@ mparse_wait(struct mparse *curp)
 		perror("wait");
 		exit((int)MANDOCLEVEL_SYSERR);
 	}
+	curp->child = 0;
 	if (WIFSIGNALED(status)) {
 		mandoc_vmsg(MANDOCERR_FILE, curp, 0, 0,
 		    "gunzip died from signal %d", WTERMSIG(status));
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2015-03-02 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 10:55 Baptiste Daroussin
2015-03-02 14:56 ` Ingo Schwarze [this message]
2015-03-09 21:04   ` Kristaps Dzonsons
2015-03-10  3:23     ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150302145633.GA28000@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=bapt@FreeBSD.org \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).