summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-07 05:26:31 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-07 05:26:31 +0000
commitd1b32a77aa379c321a1f93ded766134c0b20566e (patch)
tree5081aec4882c5c32cb87b8592edd1af051da52ba /libc
parent201ca767d53f035f6cb6b1eaeee7b32a2f2f029c (diff)
Change the global 'buf' to 'servbuf' since some functions in here use
a local named 'buf' and we want to avoid shadowing that.
Diffstat (limited to 'libc')
-rw-r--r--libc/inet/getservice.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c
index 606def8e4..cbe5c503b 100644
--- a/libc/inet/getservice.c
+++ b/libc/inet/getservice.c
@@ -85,14 +85,14 @@ static pthread_mutex_t mylock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static FILE *servf = NULL;
static struct servent serv;
-static char *buf = NULL;
+static char *servbuf = NULL;
static int serv_stayopen;
static void __initbuf(void)
{
- if (!buf) {
- buf = malloc(SBUFSIZE);
- if (!buf)
+ if (!servbuf) {
+ servbuf = malloc(SBUFSIZE);
+ if (!servbuf)
abort();
}
}
@@ -124,7 +124,7 @@ struct servent * getservent(void)
struct servent *result;
__initbuf();
- getservent_r(&serv, buf, SBUFSIZE, &result);
+ getservent_r(&serv, servbuf, SBUFSIZE, &result);
return result;
}
@@ -134,7 +134,7 @@ struct servent *getservbyname(const char *name, const char *proto)
struct servent *result;
__initbuf();
- getservbyname_r(name, proto, &serv, buf, SBUFSIZE, &result);
+ getservbyname_r(name, proto, &serv, servbuf, SBUFSIZE, &result);
return result;
}
@@ -144,7 +144,7 @@ struct servent * getservbyport(int port, const char *proto)
struct servent *result;
__initbuf();
- getservbyport_r(port, proto, &serv, buf, SBUFSIZE, &result);
+ getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result);
return result;
}