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();
}
}
struct servent *result;
__initbuf();
- getservent_r(&serv, buf, SBUFSIZE, &result);
+ getservent_r(&serv, servbuf, SBUFSIZE, &result);
return result;
}
struct servent *result;
__initbuf();
- getservbyname_r(name, proto, &serv, buf, SBUFSIZE, &result);
+ getservbyname_r(name, proto, &serv, servbuf, SBUFSIZE, &result);
return result;
}
struct servent *result;
__initbuf();
- getservbyport_r(port, proto, &serv, buf, SBUFSIZE, &result);
+ getservbyport_r(port, proto, &serv, servbuf, SBUFSIZE, &result);
return result;
}