Print this page
1926 libresolv evades compiler warnings
@@ -18,10 +18,11 @@
*
* CDDL HEADER END
*/
/*
+ * Copyright 2015 Gary Mills
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
@@ -35,12 +36,10 @@
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Send query to name server and wait for reply.
*/
#include <sys/param.h>
@@ -48,27 +47,38 @@
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
#include <errno.h>
#include <arpa/nameser.h>
+#include <arpa/inet.h>
#include <resolv.h>
+#include "crossl.h"
+/*
+ * Undocumented external function in libsocket
+ */
+extern int
+_socket(int, int, int);
static int s = -1; /* socket used for communications */
+#if BSD >= 43
static struct sockaddr no_addr;
+#endif /* BSD */
#ifndef FD_SET
#define NFDBITS 32
#define FD_SETSIZE 32
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#ifdef SYSV
-#define FD_ZERO(p) memset((void *)(p), 0, sizeof (*(p)))
+#define FD_ZERO(p) (void) memset((void *)(p), 0, sizeof (*(p)))
#else
#define FD_ZERO(p) bzero((char *)(p), sizeof (*(p)))
#endif
#endif
@@ -127,11 +137,14 @@
char *answer;
int anslen;
{
register int n;
int try, v_circuit, resplen, ns;
- int gotsomewhere = 0, connected = 0;
+ int gotsomewhere = 0;
+#if BSD >= 43
+ int connected = 0;
+#endif /* BSD */
int connreset = 0;
u_short id, len;
char *cp;
fd_set dsmask;
struct timeval timeout;