[uClibc-cvs] uClibc/libc/inet getservice.c,1.9,1.10

Erik Andersen andersen at uclibc.org
Fri May 7 05:26:33 UTC 2004


Update of /var/cvs/uClibc/libc/inet
In directory nail:/tmp/cvs-serv12946/libc/inet

Modified Files:
	getservice.c 
Log Message:
Change the global 'buf' to 'servbuf' since some functions in here use
a local named 'buf' and we want to avoid shadowing that.


Index: getservice.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/getservice.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- a/getservice.c	18 Mar 2004 11:12:33 -0000	1.9
+++ b/getservice.c	7 May 2004 05:26:31 -0000	1.10
@@ -85,14 +85,14 @@
 
 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 *result;
 
     __initbuf();
-    getservent_r(&serv, buf, SBUFSIZE, &result);
+    getservent_r(&serv, servbuf, SBUFSIZE, &result);
     return result;
 }
 
@@ -134,7 +134,7 @@
     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 *result;
 
     __initbuf();
-    getservbyport_r(port, proto, &serv, buf, SBUFSIZE, &result);
+    getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result);
     return result;
 }
 




More information about the uClibc-cvs mailing list