aboutsummaryrefslogtreecommitdiffstats
path: root/extension/readfile.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-05-09 20:31:35 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-05-09 20:31:35 +0300
commita59319732d89feda419acab674ea580c95db7d4a (patch)
tree3d30595e8f50cb1b486c9f61f93a498834c22842 /extension/readfile.c
parent8ff0b4eaa7592280b5a55087c0326c6ef1f88db5 (diff)
parentc41908d0b02f7746a67ab7aa2e54058e5b66439a (diff)
downloadegawk-a59319732d89feda419acab674ea580c95db7d4a.tar.gz
egawk-a59319732d89feda419acab674ea580c95db7d4a.tar.bz2
egawk-a59319732d89feda419acab674ea580c95db7d4a.zip
Merge branch 'xgawk'
Diffstat (limited to 'extension/readfile.c')
-rw-r--r--extension/readfile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/extension/readfile.c b/extension/readfile.c
index c9b1efc3..57cf6cdd 100644
--- a/extension/readfile.c
+++ b/extension/readfile.c
@@ -41,7 +41,7 @@ int plugin_is_GPL_compatible;
/* do_readfile --- read a file into memory */
-NODE *
+static NODE *
do_readfile(int nargs)
{
NODE *filename;
@@ -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;
}