#define N_(x) x
#define _(x) x
-static struct
+static const struct
{
int code;
const char *msg;
libc_hidden_proto(getnetent)
libc_hidden_proto(endnetent)
-extern int _net_stayopen attribute_hidden;
+extern smallint _net_stayopen attribute_hidden;
struct netent *getnetbyaddr (uint32_t net, int type)
{
libc_hidden_proto(getnetent)
libc_hidden_proto(endnetent)
-extern int _net_stayopen attribute_hidden;
+extern smallint _net_stayopen attribute_hidden;
struct netent *
getnetbyname(const char *name)
static FILE *netf = NULL;
-int _net_stayopen attribute_hidden;
+smallint _net_stayopen attribute_hidden;
libc_hidden_proto(setnetent)
void setnetent(int f)
netf = fopen(NETDB, "r" );
else
rewind(netf);
- _net_stayopen |= f;
+ if (f) _net_stayopen = 1;
__UCLIBC_MUTEX_UNLOCK(mylock);
return;
}
static FILE *protof = NULL;
static struct protoent proto;
static char *static_aliases = NULL;
-static int proto_stayopen;
+static smallint proto_stayopen;
static void __initbuf(void)
{
protof = fopen(_PATH_PROTOCOLS, "r" );
else
rewind(protof);
- proto_stayopen |= f;
+ if (f) proto_stayopen = 1;
__UCLIBC_MUTEX_UNLOCK(mylock);
}
libc_hidden_def(setprotoent)
static FILE *servf = NULL;
static struct servent serv;
static char *servbuf = NULL;
-static int serv_stayopen;
+static smallint serv_stayopen;
static void __initbuf(void)
{
servf = fopen(_PATH_SERVICES, "r" );
else
rewind(servf);
- serv_stayopen |= f;
+ if (f) serv_stayopen = 1;
__UCLIBC_MUTEX_UNLOCK(mylock);
}
libc_hidden_def(setservent)