gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, extgawk, updated. 913a0f88f5cfff1f139bb0


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, extgawk, updated. 913a0f88f5cfff1f139bb05ffd4a0a9a516ebdde
Date: Fri, 27 Jul 2012 16:23:20 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, extgawk has been updated
       via  913a0f88f5cfff1f139bb05ffd4a0a9a516ebdde (commit)
      from  fbff497e69139d7cd8434112d6f0a36a46350da1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=913a0f88f5cfff1f139bb05ffd4a0a9a516ebdde

commit 913a0f88f5cfff1f139bb05ffd4a0a9a516ebdde
Author: Andrew J. Schorr <address@hidden>
Date:   Fri Jul 27 12:22:50 2012 -0400

    The readdir extension should set the error code if readdir fails.

diff --git a/extension/ChangeLog b/extension/ChangeLog
index 5e39135..2023a76 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-27         Andrew J. Schorr     <address@hidden>
+
+       * readdir.c (dir_get_record): If readdir fails, set errcode.  Otherwise,
+       don't bother to set errcode.
+
 2012-07-27         Arnold D. Robbins     <address@hidden>
 
        * readdir.c (dir_take_control_of): Fix typo for case where
diff --git a/extension/readdir.c b/extension/readdir.c
index c2b6cbd..f858056 100644
--- a/extension/readdir.c
+++ b/extension/readdir.c
@@ -130,10 +130,8 @@ dir_get_record(char **out, struct iobuf_public *iobuf, int 
*errcode)
 
        /*
         * The caller sets *errcode to 0, so we should set it only if an
-        * error occurs. Except that the compiler complains that it
-        * is unused, so we set it anyways.
+        * error occurs.
         */
-       *errcode = 0;   /* keep the compiler happy */
 
        if (out == NULL || iobuf == NULL || iobuf->opaque == NULL)
                return EOF;
@@ -142,8 +140,10 @@ dir_get_record(char **out, struct iobuf_public *iobuf, int 
*errcode)
        the_dir = (open_directory_t *) iobuf->opaque;
        dp = the_dir->dp;
        dirent = readdir(dp);
-       if (dirent == NULL)
+       if (dirent == NULL) {
+               *errcode = errno;       /* in case there was an error */
                return EOF;
+       }
 
        if (do_ftype)
                sprintf(the_dir->buf, "%ld/%s/%s",

-----------------------------------------------------------------------

Summary of changes:
 extension/ChangeLog |    5 +++++
 extension/readdir.c |    8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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