bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: another gawk 3.1.2 bug


From: Paul Eggert
Subject: Re: another gawk 3.1.2 bug
Date: 28 Apr 2003 09:33:04 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Aharon Robbins <address@hidden> writes:

> Interpreting this depends upon what it means to "close successfully".
> Gawk successfully does a close(2) on the file descriptor(s) and a wait(2)
> on the child process.  Thus the *act of closing* succeeds, and in this
> case, *as I read the standard*, it should return 0.

No, when you're closing a pipe, the appropriate primitive is 'pclose'
(or equivalent), not 'close'.  This is for the same reason that, if
you are closing an ordinary file that you opened via stdio, the
appropriate primitive is 'fclose', not 'close'.

That is why Kernighan's awk simply returns pclose's result for pipes,
and fclose's result for ordinary files.  This clearly conforms to the
POSIX standard.  Therefore, you needn't change gawk's behavior if
POSIXLY_CORRECT is set.

If you're still not convinced, I can submit an official interpretation
on this point, but I'm positive that the answer will come back "yes".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]