From bb7ad3a8d10f93ccbea617ec3bc177a70808d6b6 Mon Sep 17 00:00:00 2001 From: kcwu Date: Mon, 15 Jun 2009 12:18:12 +0000 Subject: * 'l' looks like '1' and confusing. rename to 's'. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4622 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- common/sys/net.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/common/sys/net.c b/common/sys/net.c index cf6ca658..3e65a697 100644 --- a/common/sys/net.c +++ b/common/sys/net.c @@ -186,18 +186,18 @@ int toconnect(const char *addr) */ int toread(int fd, void *buf, int len) { - int l; - for( l = 0 ; len > 0 ; ) - if( (l = read(fd, buf, len)) <= 0 ) { - if (l < 0 && (errno == EINTR || errno == EAGAIN)) + int s; + for( s = 0 ; len > 0 ; ) + if( (s = read(fd, buf, len)) <= 0 ) { + if (s < 0 && (errno == EINTR || errno == EAGAIN)) continue; // XXX we define toread/towrite as '-1 for EOF and error'. - return -1; // l; + return -1; // s; }else{ - buf += l; - len -= l; + buf += s; + len -= s; } - return l; + return s; } /** @@ -205,18 +205,18 @@ int toread(int fd, void *buf, int len) */ int towrite(int fd, const void *buf, int len) { - int l; - for( l = 0 ; len > 0 ; ) - if( (l = write(fd, buf, len)) <= 0){ - if (l < 0 && (errno == EINTR || errno == EAGAIN)) + int s; + for( s = 0 ; len > 0 ; ) + if( (s = write(fd, buf, len)) <= 0){ + if (s < 0 && (errno == EINTR || errno == EAGAIN)) continue; // XXX we define toread/towrite as '-1 for EOF and error'. - return -1; // l; + return -1; // s; }else{ - buf += l; - len -= l; + buf += s; + len -= s; } - return l; + return s; } /** -- cgit v1.2.3