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

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

gawk not always setting ERRNO properly?


From: Andrew J. Schorr
Subject: gawk not always setting ERRNO properly?
Date: Mon, 14 Mar 2005 15:56:01 -0500
User-agent: Mutt/1.4.1i

Hi,

Looking at the gawk 3.1.4 source code, it seems to me that in certain
cases the ERRNO string may not be set properly.  The update_ERRNO
function always uses the current value of errno to set the string,
even though functions such as get_a_record and redirect return an
explicit errno value to be used in setting ERRNO.

It seems that there are 2 ways to fix this:

1. Before calling update_ERRNO, assign the desired error code to errno.

2. Create a new function that allows the caller to specify the errno value.

The attached patch uses method #2.  Does this make sense?

Note: I took this diff against the xmlgawk tree, so there's a little bit
of stuff that doesn't make sense for regular gawk (please ignore).

Regards,
Andy

Attachment: update_errno.patch
Description: Text document


reply via email to

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