diff options
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | TODO.xgawk | 12 | ||||
-rw-r--r-- | awk.h | 6 | ||||
-rw-r--r-- | doc/ChangeLog | 7 | ||||
-rw-r--r-- | doc/gawk.info | 108 | ||||
-rw-r--r-- | doc/gawk.texi | 32 | ||||
-rw-r--r-- | eval.c | 22 | ||||
-rw-r--r-- | ext.c | 3 | ||||
-rw-r--r-- | extension/ChangeLog | 8 | ||||
-rw-r--r-- | extension/filefuncs.c | 4 | ||||
-rw-r--r-- | extension/fork.c | 4 | ||||
-rw-r--r-- | extension/readfile.c | 8 | ||||
-rw-r--r-- | extension/rwarray.c | 4 | ||||
-rw-r--r-- | io.c | 22 |
14 files changed, 157 insertions, 103 deletions
@@ -1,7 +1,19 @@ -2012-03-27 Andrew J. Schorr <aschorr@telemetry-investments.com> - - * .gitignore: Add libtool, since this is created by configure. - * libtool: Remove from repo. +2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * TODO.xgawk: Move ERRNO item into "done" section. + * awk.h (update_ERRNO, update_ERRNO_saved): Remove declarations. + (update_ERRNO_int, enum errno_translate, update_ERRNO_string, + unset_ERRNO): Add new declarations. + * eval.c (update_ERRNO_saved): Renamed to update_ERRNO_int. + (update_ERRNO_string, unset_ERRNO): New functions. + * ext.c (do_ext): Use new update_ERRNO_string function. + * io.c (ERRNO_node): Remove redundant extern declaration (in awk.h). + (after_beginfile, nextfile): Replace update_ERRNO() with + update_ERRNO_int(errno). + (inrec): Replace update_ERRNO_saved with update_ERRNO_int. + (do_close): Use new function update_ERRNO_string. + (close_redir, do_getline_redir, do_getline): Replace update_ERRNO_saved + with update_ERRNO_int. 2012-03-27 Andrew J. Schorr <aschorr@telemetry-investments.com> @@ -13,6 +13,12 @@ Done: - Implement @load +- Patch ERRNO handling to create a simple API for use by extensions: + extern void update_ERRNO_int(int) + enum errno_translate { TRANSLATE, DONT_TRANSLATE }; + extern void update_ERRNO_string(const char *string, enum errno_translate); + extern void unset_ERRNO(void); + To do (not necessarily in this order): @@ -49,12 +55,6 @@ To do (not necessarily in this order): - Add tests for standard extensions. -- Patch ERRNO handling to create a simple API for use by extensions: - extern void update_ERRNO_int(int) - enum errno_translate { TRANSLATE, DONT_TRANSLATE }; - extern void update_ERRNO_string(const char *string, enum errno_translate); - extern void unset_ERRNO(void); - - Develop a libgawk shared library for use by extensions. In particular, a few existing extensions use a hash API for mapping string handles to structures. In xgawk, we had this API inside array.c, but it probably @@ -1376,8 +1376,10 @@ extern void set_CONVFMT(void); extern void set_BINMODE(void); extern void set_LINT(void); extern void set_TEXTDOMAIN(void); -extern void update_ERRNO(void); -extern void update_ERRNO_saved(int); +extern void update_ERRNO_int(int); +enum errno_translate { TRANSLATE, DONT_TRANSLATE }; +extern void update_ERRNO_string(const char *string, enum errno_translate); +extern void unset_ERRNO(void); extern void update_NR(void); extern void update_NF(void); extern void update_FNR(void); diff --git a/doc/ChangeLog b/doc/ChangeLog index 815644ca..568d7c78 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * gawk.texi: Replace documentation of removed functions update_ERRNO and + update_ERRNO_saved with descriptions new functions update_ERRNO_int, + update_ERRNO_string and unset_ERRNO. And fix a couple of examples + to use update_ERRNO_int instead of update_ERRNO. + 2012-03-26 Arnold D. Robbins <arnold@skeeve.com> * gawk.texi: Minor style edits. diff --git a/doc/gawk.info b/doc/gawk.info index 8e27f4a3..75e1f481 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -22046,16 +22046,22 @@ when writing extensions. The next minor node shows how they are used: `get_array_argument(i, opt)' This is a convenience macro that calls `get_actual_argument()'. -`void update_ERRNO(void)' - This function is called from within a C extension function to set - the value of `gawk''s `ERRNO' variable, based on the current value - of the C `errno' global variable. It is provided as a convenience. - -`void update_ERRNO_saved(int errno_saved)' +`void update_ERRNO_int(int errno_saved)' This function is called from within a C extension function to set the value of `gawk''s `ERRNO' variable, based on the error value provided as the argument. It is provided as a convenience. +`void update_ERRNO_string(const char *string, enum errno_translate)' + This function is called from within a C extension function to set + the value of `gawk''s `ERRNO' variable to a given string. The + second argument determines whether the string is translated before + being installed into `ERRNO'. It is provided as a convenience. + +`void unset_ERRNO(void)' + This function is called from within a C extension function to set + the value of `gawk''s `ERRNO' variable to a null string. It is + provided as a convenience. + `void register_deferred_variable(const char *name, NODE *(*load_func)(void))' This function is called to register a function to be called when a reference to an undefined variable with the given name is @@ -22361,7 +22367,7 @@ system call. If the `chdir()' fails, `ERRNO' is updated. (void) force_string(newdir); ret = chdir(newdir->stptr); if (ret < 0) - update_ERRNO(); + update_ERRNO_int(errno); Finally, the function returns the return value to the `awk' level: @@ -22414,7 +22420,7 @@ link. If there's an error, it sets `ERRNO' and returns: (void) force_string(file); ret = lstat(file->stptr, & sbuf); if (ret < 0) { - update_ERRNO(); + update_ERRNO_int(errno); return make_number((AWKNUM) ret); } @@ -25519,7 +25525,7 @@ Index * close() function, two-way pipes and: Two-way I/O. (line 77) * Close, Diane <1>: Contributors. (line 21) * Close, Diane: Manual History. (line 41) -* close_func() input method: Internals. (line 151) +* close_func() input method: Internals. (line 157) * collating elements: Bracket Expressions. (line 69) * collating symbols: Bracket Expressions. (line 76) * Colombo, Antonio: Acknowledgments. (line 60) @@ -25936,7 +25942,7 @@ Index * endgrent() user-defined function: Group Functions. (line 218) * endpwent() function (C library): Passwd Functions. (line 210) * endpwent() user-defined function: Passwd Functions. (line 213) -* ENVIRON array <1>: Internals. (line 140) +* ENVIRON array <1>: Internals. (line 146) * ENVIRON array: Auto-set. (line 60) * environment variables: Auto-set. (line 60) * epoch, definition of: Glossary. (line 239) @@ -25994,7 +26000,7 @@ Index (line 9) * expressions, selecting: Conditional Exp. (line 6) * Extended Regular Expressions (EREs): Bracket Expressions. (line 24) -* eXtensible Markup Language (XML): Internals. (line 151) +* eXtensible Markup Language (XML): Internals. (line 157) * extension() function (gawk): Using Internal File Ops. (line 15) * extensions, Brian Kernighan's awk <1>: Other Versions. (line 13) @@ -26335,7 +26341,7 @@ Index * get_actual_argument() internal function: Internals. (line 116) * get_argument() internal function: Internals. (line 111) * get_array_argument() internal macro: Internals. (line 127) -* get_record() input method: Internals. (line 151) +* get_record() input method: Internals. (line 157) * get_scalar_argument() internal macro: Internals. (line 124) * getaddrinfo() function (C library): TCP/IP Networking. (line 38) * getgrent() function (C library): Group Functions. (line 6) @@ -26489,7 +26495,7 @@ Index * integers: Basic Data Typing. (line 21) * integers, unsigned: Basic Data Typing. (line 30) * interacting with other programs: I/O Functions. (line 63) -* internal constant, INVALID_HANDLE: Internals. (line 151) +* internal constant, INVALID_HANDLE: Internals. (line 157) * internal function, assoc_clear(): Internals. (line 68) * internal function, assoc_lookup(): Internals. (line 72) * internal function, dupnode(): Internals. (line 87) @@ -26498,18 +26504,19 @@ Index * internal function, force_wstring(): Internals. (line 37) * internal function, get_actual_argument(): Internals. (line 116) * internal function, get_argument(): Internals. (line 111) -* internal function, iop_alloc(): Internals. (line 151) +* internal function, iop_alloc(): Internals. (line 157) * internal function, make_builtin(): Internals. (line 97) * internal function, make_number(): Internals. (line 82) * internal function, make_string(): Internals. (line 77) -* internal function, register_deferred_variable(): Internals. (line 140) -* internal function, register_open_hook(): Internals. (line 151) +* internal function, register_deferred_variable(): Internals. (line 146) +* internal function, register_open_hook(): Internals. (line 157) * internal function, unref(): Internals. (line 92) -* internal function, update_ERRNO(): Internals. (line 130) -* internal function, update_ERRNO_saved(): Internals. (line 135) +* internal function, unset_ERRNO(): Internals. (line 141) +* internal function, update_ERRNO_int(): Internals. (line 130) +* internal function, update_ERRNO_string(): Internals. (line 135) * internal macro, get_array_argument(): Internals. (line 127) * internal macro, get_scalar_argument(): Internals. (line 124) -* internal structure, IOBUF: Internals. (line 151) +* internal structure, IOBUF: Internals. (line 157) * internal type, AWKNUM: Internals. (line 19) * internal type, NODE: Internals. (line 23) * internal variable, nargs: Internals. (line 42) @@ -26538,10 +26545,10 @@ Index * interpreted programs <1>: Glossary. (line 361) * interpreted programs: Basic High Level. (line 14) * interval expressions: Regexp Operators. (line 116) -* INVALID_HANDLE internal constant: Internals. (line 151) +* INVALID_HANDLE internal constant: Internals. (line 157) * inventory-shipped file: Sample Data Files. (line 32) -* IOBUF internal structure: Internals. (line 151) -* iop_alloc() internal function: Internals. (line 151) +* IOBUF internal structure: Internals. (line 157) +* iop_alloc() internal function: Internals. (line 157) * isarray() function (gawk): Type Functions. (line 11) * ISO: Glossary. (line 372) * ISO 8859-1: Glossary. (line 141) @@ -27036,7 +27043,7 @@ Index * private variables: Library Names. (line 11) * processes, two-way communications with: Two-way I/O. (line 23) * processing data: Basic High Level. (line 6) -* PROCINFO array <1>: Internals. (line 140) +* PROCINFO array <1>: Internals. (line 146) * PROCINFO array <2>: Id Program. (line 15) * PROCINFO array <3>: Group Functions. (line 6) * PROCINFO array <4>: Passwd Functions. (line 6) @@ -27132,8 +27139,8 @@ Index * regexp constants, slashes vs. quotes: Computed Regexps. (line 28) * regexp constants, vs. string constants: Computed Regexps. (line 38) * regexp, See regular expressions: Regexp. (line 6) -* register_deferred_variable() internal function: Internals. (line 140) -* register_open_hook() internal function: Internals. (line 151) +* register_deferred_variable() internal function: Internals. (line 146) +* register_open_hook() internal function: Internals. (line 157) * regular expressions: Regexp. (line 6) * regular expressions as field separators: Field Separators. (line 50) * regular expressions, anchors in: Regexp Operators. (line 22) @@ -27531,14 +27538,15 @@ Index * Unix, awk scripts and: Executable Scripts. (line 6) * UNIXROOT variable, on OS/2 systems: PC Using. (line 17) * unref() internal function: Internals. (line 92) +* unset_ERRNO() internal function: Internals. (line 141) * unsigned integers: Basic Data Typing. (line 30) * until debugger command: Debugger Execution Control. (line 83) * unwatch debugger command: Viewing And Changing Data. (line 84) * up debugger command: Execution Stack. (line 33) -* update_ERRNO() internal function: Internals. (line 130) -* update_ERRNO_saved() internal function: Internals. (line 135) +* update_ERRNO_int() internal function: Internals. (line 130) +* update_ERRNO_string() internal function: Internals. (line 135) * user database, reading: Passwd Functions. (line 6) * user-defined, functions: User-defined. (line 6) * user-defined, functions, counts: Profiling. (line 129) @@ -27627,7 +27635,7 @@ Index * wstptr internal variable: Internals. (line 54) * xgawk: Other Versions. (line 120) * xgettext utility: String Extraction. (line 13) -* XML (eXtensible Markup Language): Internals. (line 151) +* XML (eXtensible Markup Language): Internals. (line 157) * XOR bitwise operation: Bitwise Functions. (line 6) * xor() function (gawk): Bitwise Functions. (line 54) * Yawitz, Efraim: Contributors. (line 106) @@ -28059,27 +28067,27 @@ Node: Adding Code868034 Node: New Ports874001 Node: Dynamic Extensions878114 Node: Internals879554 -Node: Plugin License888073 -Node: Loading Extensions888711 -Node: Sample Library890550 -Node: Internal File Description891240 -Node: Internal File Ops894955 -Ref: Internal File Ops-Footnote-1899679 -Node: Using Internal File Ops899819 -Node: Future Extensions902196 -Node: Basic Concepts904700 -Node: Basic High Level905457 -Ref: Basic High Level-Footnote-1909492 -Node: Basic Data Typing909677 -Node: Floating Point Issues914202 -Node: String Conversion Precision915285 -Ref: String Conversion Precision-Footnote-1916985 -Node: Unexpected Results917094 -Node: POSIX Floating Point Problems918920 -Ref: POSIX Floating Point Problems-Footnote-1922625 -Node: Glossary922663 -Node: Copying947639 -Node: GNU Free Documentation License985196 -Node: Index1010333 +Node: Plugin License888376 +Node: Loading Extensions889014 +Node: Sample Library890853 +Node: Internal File Description891543 +Node: Internal File Ops895258 +Ref: Internal File Ops-Footnote-1900000 +Node: Using Internal File Ops900140 +Node: Future Extensions902517 +Node: Basic Concepts905021 +Node: Basic High Level905778 +Ref: Basic High Level-Footnote-1909813 +Node: Basic Data Typing909998 +Node: Floating Point Issues914523 +Node: String Conversion Precision915606 +Ref: String Conversion Precision-Footnote-1917306 +Node: Unexpected Results917415 +Node: POSIX Floating Point Problems919241 +Ref: POSIX Floating Point Problems-Footnote-1922946 +Node: Glossary922984 +Node: Copying947960 +Node: GNU Free Documentation License985517 +Node: Index1010654 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index eaad54d2..7b46026b 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -29460,21 +29460,29 @@ This is a convenience macro that calls @code{get_actual_argument()}. @cindex functions, return values@comma{} setting @cindex @code{ERRNO} variable -@cindex @code{update_ERRNO()} internal function -@cindex internal function, @code{update_ERRNO()} -@item void update_ERRNO(void) +@cindex @code{update_ERRNO_int()} internal function +@cindex internal function, @code{update_ERRNO_int()} +@item void update_ERRNO_int(int errno_saved) This function is called from within a C extension function to set -the value of @command{gawk}'s @code{ERRNO} variable, based on the current -value of the C @code{errno} global variable. +the value of @command{gawk}'s @code{ERRNO} variable, based on the error +value provided as the argument. It is provided as a convenience. @cindex @code{ERRNO} variable -@cindex @code{update_ERRNO_saved()} internal function -@cindex internal function, @code{update_ERRNO_saved()} -@item void update_ERRNO_saved(int errno_saved) +@cindex @code{update_ERRNO_string()} internal function +@cindex internal function, @code{update_ERRNO_string()} +@item void update_ERRNO_string(const char *string, enum errno_translate) This function is called from within a C extension function to set -the value of @command{gawk}'s @code{ERRNO} variable, based on the error -value provided as the argument. +the value of @command{gawk}'s @code{ERRNO} variable to a given string. +The second argument determines whether the string is translated before being +installed into @code{ERRNO}. It is provided as a convenience. + +@cindex @code{ERRNO} variable +@cindex @code{unset_ERRNO()} internal function +@cindex internal function, @code{unset_ERRNO()} +@item void unset_ERRNO(void) +This function is called from within a C extension function to set +the value of @command{gawk}'s @code{ERRNO} variable to a null string. It is provided as a convenience. @cindex @code{ENVIRON} array @@ -29838,7 +29846,7 @@ is updated. (void) force_string(newdir); ret = chdir(newdir->stptr); if (ret < 0) - update_ERRNO(); + update_ERRNO_int(errno); @end example Finally, the function returns the return value to the @command{awk} level: @@ -29907,7 +29915,7 @@ If there's an error, it sets @code{ERRNO} and returns: (void) force_string(file); ret = lstat(file->stptr, & sbuf); if (ret < 0) @{ - update_ERRNO(); + update_ERRNO_int(errno); return make_number((AWKNUM) ret); @} @end example @@ -988,10 +988,10 @@ set_TEXTDOMAIN() */ } -/* update_ERRNO_saved --- update the value of ERRNO based on argument */ +/* update_ERRNO_int --- update the value of ERRNO based on argument */ void -update_ERRNO_saved(int errcode) +update_ERRNO_int(int errcode) { char *cp; @@ -1004,12 +1004,24 @@ update_ERRNO_saved(int errcode) ERRNO_node->var_value = make_string(cp, strlen(cp)); } -/* update_ERRNO --- update the value of ERRNO based on errno */ +/* update_ERRNO_string --- update ERRNO with optionally translated string */ void -update_ERRNO() +update_ERRNO_string(const char *string, enum errno_translate translate) { - update_ERRNO_saved(errno); + if (translate == TRANSLATE) + string = gettext(string); + unref(ERRNO_node->var_value); + ERRNO_node->var_value = make_string(string, strlen(string)); +} + +/* unset_ERRNO --- eliminate the value of ERRNO */ + +void +unset_ERRNO(void) +{ + unref(ERRNO_node->var_value); + ERRNO_node->var_value = Nnull_string; } /* update_NR --- update the value of NR */ @@ -254,8 +254,7 @@ do_ext(int nargs) { const char *emsg = _("Operation Not Supported"); - unref(ERRNO_node->var_value); - ERRNO_node->var_value = make_string(emsg, strlen(emsg)); + update_ERRNO_string(emsg, DONT_TRANSLATE); return make_number((AWKNUM) -1); } diff --git a/extension/ChangeLog b/extension/ChangeLog index e0a6245b..dc017d30 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,11 @@ +2012-04-01 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * filefuncs.c (do_chdir, do_stat): Replace update_ERRNO() with + update_ERRNO_int(errno). + * fork.c (do_fork, do_waitpid): Ditto. + * readfile.c (do_readfile): Ditto. + * rwarray.c (do_writea, do_reada): Ditto. + 2012-03-25 Andrew J. Schorr <aschorr@telemetry-investments.com> * Makefile.am: Major cleanup. Use libtool options -module and diff --git a/extension/filefuncs.c b/extension/filefuncs.c index dd1b29a8..63010c35 100644 --- a/extension/filefuncs.c +++ b/extension/filefuncs.c @@ -48,7 +48,7 @@ do_chdir(int nargs) (void) force_string(newdir); ret = chdir(newdir->stptr); if (ret < 0) - update_ERRNO(); + update_ERRNO_int(errno); return make_number((AWKNUM) ret); } @@ -183,7 +183,7 @@ do_stat(int nargs) (void) force_string(file); ret = lstat(file->stptr, & sbuf); if (ret < 0) { - update_ERRNO(); + update_ERRNO_int(errno); return make_number((AWKNUM) ret); } diff --git a/extension/fork.c b/extension/fork.c index 88353879..8b8558e6 100644 --- a/extension/fork.c +++ b/extension/fork.c @@ -44,7 +44,7 @@ do_fork(int nargs) ret = fork(); if (ret < 0) - update_ERRNO(); + update_ERRNO_int(errno); else if (ret == 0) { /* update PROCINFO in the child */ @@ -83,7 +83,7 @@ do_waitpid(int nargs) options = WNOHANG|WUNTRACED; ret = waitpid(pid, NULL, options); if (ret < 0) - update_ERRNO(); + update_ERRNO_int(errno); } else if (do_lint) lintwarn("wait: called with no arguments"); diff --git a/extension/readfile.c b/extension/readfile.c index c9b1efc3..9c18601d 100644 --- a/extension/readfile.c +++ b/extension/readfile.c @@ -59,18 +59,18 @@ do_readfile(int nargs) ret = stat(filename->stptr, & sbuf); if (ret < 0) { - update_ERRNO(); + update_ERRNO_int(errno); goto done; } else if ((sbuf.st_mode & S_IFMT) != S_IFREG) { errno = EINVAL; ret = -1; - update_ERRNO(); + update_ERRNO_int(errno); goto done; } if ((fd = open(filename->stptr, O_RDONLY|O_BINARY)) < 0) { ret = -1; - update_ERRNO(); + update_ERRNO_int(errno); goto done; } @@ -80,7 +80,7 @@ do_readfile(int nargs) if ((ret = read(fd, text, sbuf.st_size)) != sbuf.st_size) { (void) close(fd); ret = -1; - update_ERRNO(); + update_ERRNO_int(errno); goto done; } diff --git a/extension/rwarray.c b/extension/rwarray.c index 8175c7c0..f4f8cd58 100644 --- a/extension/rwarray.c +++ b/extension/rwarray.c @@ -115,7 +115,7 @@ do_writea(int nargs) done1: ret = -1; - update_ERRNO(); + update_ERRNO_int(errno); unlink(file->stptr); done0: @@ -297,7 +297,7 @@ do_reada(int nargs) done1: ret = -1; - update_ERRNO(); + update_ERRNO_int(errno); done0: close(fd); @@ -230,7 +230,6 @@ extern int output_is_tty; extern NODE *ARGC_node; extern NODE *ARGV_node; extern NODE *ARGIND_node; -extern NODE *ERRNO_node; extern NODE **fields_arr; @@ -308,7 +307,7 @@ after_beginfile(IOBUF **curfile) errcode = iop->errcode; iop->errcode = 0; errno = 0; - update_ERRNO(); + update_ERRNO_int(errno); iop_close(iop); *curfile = NULL; if (errcode == EISDIR && ! do_traditional) { @@ -382,7 +381,7 @@ nextfile(IOBUF **curfile, int skipping) fd = devopen(fname, binmode("r")); errcode = errno; if (! do_traditional) - update_ERRNO(); + update_ERRNO_int(errno); /* This is a kludge. */ unref(FILENAME_node->var_value); @@ -404,7 +403,7 @@ nextfile(IOBUF **curfile, int skipping) /* FNR is init'ed to 0 */ errno = 0; if (! do_traditional) - update_ERRNO(); + update_ERRNO_int(errno); unref(FILENAME_node->var_value); FILENAME_node->var_value = make_string("-", 1); FILENAME_node->var_value->flags |= MAYBE_NUM; /* be pedantic */ @@ -415,7 +414,7 @@ nextfile(IOBUF **curfile, int skipping) if (iop->fd == INVALID_HANDLE) { errcode = errno; errno = 0; - update_ERRNO(); + update_ERRNO_int(errno); (void) iop_close(iop); *curfile = NULL; fatal(_("cannot open file `%s' for reading (%s)"), @@ -462,7 +461,7 @@ inrec(IOBUF *iop, int *errcode) if (cnt == EOF) { retval = 1; if (*errcode > 0) - update_ERRNO_saved(*errcode); + update_ERRNO_int(*errcode); } else { NR += 1; FNR += 1; @@ -990,8 +989,7 @@ do_close(int nargs) if (! do_traditional) { /* update ERRNO manually, using errno = ENOENT is a stretch. */ cp = _("close of redirection that was never opened"); - unref(ERRNO_node->var_value); - ERRNO_node->var_value = make_string(cp, strlen(cp)); + update_ERRNO_string(cp, DONT_TRANSLATE); } DEREF(tmp); @@ -1111,7 +1109,7 @@ close_redir(struct redirect *rp, int exitwarn, two_way_close_type how) if (! do_traditional) { /* set ERRNO too so that program can get at it */ - update_ERRNO_saved(save_errno); + update_ERRNO_int(save_errno); } } @@ -2228,7 +2226,7 @@ do_getline_redir(int intovar, int redirtype) if (rp == NULL) { if (redir_error) { /* failed redirect */ if (! do_traditional) - update_ERRNO_saved(redir_error); + update_ERRNO_int(redir_error); } return make_number((AWKNUM) -1.0); } @@ -2240,7 +2238,7 @@ do_getline_redir(int intovar, int redirtype) cnt = get_a_record(&s, iop, &errcode); if (errcode != 0) { if (! do_traditional && (errcode != -1)) - update_ERRNO_saved(errcode); + update_ERRNO_int(errcode); return make_number((AWKNUM) -1.0); } @@ -2288,7 +2286,7 @@ do_getline(int intovar, IOBUF *iop) cnt = get_a_record(&s, iop, &errcode); if (errcode != 0) { if (! do_traditional && (errcode != -1)) - update_ERRNO_saved(errcode); + update_ERRNO_int(errcode); if (intovar) (void) POP_ADDRESS(); return make_number((AWKNUM) -1.0); |