[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, read_timeout, updated. b3dcc664da5e5234a
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, read_timeout, updated. b3dcc664da5e5234af8fbc1e2725788b614c747c |
Date: |
Mon, 02 Jan 2012 19:36:59 +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, read_timeout has been updated
via b3dcc664da5e5234af8fbc1e2725788b614c747c (commit)
from d84926f0d651d5f55b1be3b760b572a50197593f (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=b3dcc664da5e5234af8fbc1e2725788b614c747c
commit b3dcc664da5e5234af8fbc1e2725788b614c747c
Author: Arnold D. Robbins <address@hidden>
Date: Mon Jan 2 21:36:16 2012 +0200
Stylistic edits.
diff --git a/ChangeLog b/ChangeLog
index 8fe80ac..f5d1a8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-02 Arnold D. Robbins <address@hidden>
+
+ * io.c (Read_can_timeout, Read_timeout, Read_default_timeout):
+ Renamed to use lower case.
+ Other minor stylistic edits.
+
2012-01-01 John Haque <address@hidden>
* awk.h (struct iobuf): New entry read_func.
diff --git a/io.c b/io.c
index ca59b5c..46dba96 100644
--- a/io.c
+++ b/io.c
@@ -214,9 +214,9 @@ static ssize_t read_with_timeout(int fd, char *buf, size_t
size);
#include "popen.h"
#endif
-static int Read_can_timeout = FALSE;
-static long Read_timeout;
-static long Read_default_timeout;
+static int read_can_timeout = FALSE;
+static long read_timeout;
+static long read_default_timeout;
static struct redirect *red_head = NULL;
static NODE *RS = NULL;
@@ -239,22 +239,24 @@ init_io()
{
long tmout;
- /* N.B.: all these hacks are to minimize the affect
+ /*
+ * N.B.: all these hacks are to minimize the effect
* on programs that do not care about timeout.
*/
/* Parse the env. variable only once */
tmout = getenv_long("GAWK_READ_TIMEOUT");
if (tmout > 0) {
- Read_default_timeout = tmout;
- Read_can_timeout = TRUE;
+ read_default_timeout = tmout;
+ read_can_timeout = TRUE;
}
- /* PROCINFO entries for timeout are dynamic;
+ /*
+ * PROCINFO entries for timeout are dynamic;
* We can't be any more specific than this.
*/
if (PROCINFO_node != NULL)
- Read_can_timeout = TRUE;
+ read_can_timeout = TRUE;
}
@@ -479,7 +481,7 @@ remap_std_file(int oldfd)
int ret = -1;
/*
- * Give OS-specific routines in gawkmisc.c chance to interpret
+ * Give OS-specific routines in gawkmisc.c a chance to interpret
* "/dev/null" as appropriate for their platforms.
*/
newfd = os_devopen("/dev/null", O_RDWR);
@@ -3016,8 +3018,8 @@ get_a_record(char **out, /* pointer to pointer to
data */
if (at_eof(iop) && no_data_left(iop))
return EOF;
- if (Read_can_timeout)
- Read_timeout = get_read_timeout(iop);
+ if (read_can_timeout)
+ read_timeout = get_read_timeout(iop);
if (iop->get_record != NULL)
return (*iop->get_record)(out, iop, errcode);
@@ -3315,7 +3317,8 @@ inetfile(const char *str, int *length, int *family)
return ret;
}
-/* in_PROCINFO --- return value for a PROCINFO element with
+/*
+ * in_PROCINFO --- return value for a PROCINFO element with
* SUBSEP seperated indices.
*/
@@ -3346,7 +3349,8 @@ in_PROCINFO(const char *pidx1, const char *pidx2, NODE
**full_idx)
sub->stlen = str_len;
}
- sprintf(sub->stptr, "%s%.*s%s", pidx1, subsep->stlen, subsep->stptr,
pidx2);
+ sprintf(sub->stptr, "%s%.*s%s", pidx1, (int)subsep->stlen,
+ subsep->stptr, pidx2);
r = in_array(PROCINFO_node, sub);
if (! full_idx)
unref(sub);
@@ -3360,7 +3364,6 @@ static long
get_read_timeout(IOBUF *iop)
{
long tmout = 0;
- char *cp;
if (PROCINFO_node != NULL) {
const char *name = iop->name;
@@ -3368,8 +3371,9 @@ get_read_timeout(IOBUF *iop)
static NODE *full_idx = NULL;
static const char *last_name = NULL;
- /* Do not re-construct the full index when last redirection
string is
- * the same as the current; "efficiency_hack++".
+ /*
+ * Do not re-construct the full index when last redirection
+ * string is the same as the current; "efficiency_hack++".
*/
if (full_idx == NULL || strcmp(name, last_name) != 0) {
val = in_PROCINFO(name, "READ_TIMEOUT", & full_idx);
@@ -3379,15 +3383,16 @@ get_read_timeout(IOBUF *iop)
if (val != NULL)
tmout = (long) force_number(val);
} else
- tmout = Read_default_timeout; /* initialized from env.
variable in init_io() */
+ tmout = read_default_timeout; /* initialized from env.
variable in init_io() */
iop->read_func = tmout > 0 ? read_with_timeout : ( ssize_t(*)() ) read;
return tmout;
}
-/* read_with_timeout --- read with a timeout, return failure
- if no data is available within the timeout period.
-*/
+/*
+ * read_with_timeout --- read with a timeout, return failure
+ * if no data is available within the timeout period.
+ */
static ssize_t
read_with_timeout(int fd, char *buf, size_t size)
@@ -3395,8 +3400,8 @@ read_with_timeout(int fd, char *buf, size_t size)
fd_set readfds;
struct timeval tv;
- tv.tv_sec = Read_timeout / 1000;
- tv.tv_usec = 1000 * (Read_timeout - 1000 * tv.tv_sec);
+ tv.tv_sec = read_timeout / 1000;
+ tv.tv_usec = 1000 * (read_timeout - 1000 * tv.tv_sec);
FD_ZERO(& readfds);
FD_SET(fd, & readfds);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
io.c | 49 +++++++++++++++++++++++++++----------------------
2 files changed, 33 insertions(+), 22 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, read_timeout, updated. b3dcc664da5e5234af8fbc1e2725788b614c747c,
Arnold Robbins <=