revert cygwin stuff

This commit is contained in:
Erik Ekman 2009-01-24 22:12:00 +00:00
parent ad5c401762
commit d08da80160
8 changed files with 3 additions and 79 deletions

View File

@ -15,11 +15,7 @@
*/
#include <arpa/inet.h>
#ifndef __CYGWIN__
#include <arpa/nameser.h>
#else
#include "windows.h"
#endif
#include <netinet/in.h>
#ifdef DARWIN
#include <arpa/nameser8_compat.h>
@ -42,7 +38,7 @@
#include "common.h"
/* daemon(3) exists only in 4.4BSD or later, and in GNU libc */
#if !(defined(__CYGWIN__)) && !(defined(BSD) && (BSD >= 199306)) && !defined(__GLIBC__)
#if !(defined(BSD) && (BSD >= 199306)) && !defined(__GLIBC__)
static int daemon(int nochdir, int noclose)
{
int fd, i;
@ -90,13 +86,11 @@ int setgroups(int count, int *groups)
void
check_superuser(void (*usage_fn)(void))
{
#ifndef __CYGWIN__
if (geteuid() != 0) {
warnx("Run as root and you'll be happy.\n");
usage_fn();
/* NOTREACHED */
}
#endif
}
int

View File

@ -15,11 +15,7 @@
*/
#include <arpa/inet.h>
#ifndef __CYGWIN__
#include <arpa/nameser.h>
#else
#include "windows.h"
#endif
#ifdef DARWIN
#include <arpa/nameser8_compat.h>
#endif

View File

@ -32,11 +32,7 @@
#include <pwd.h>
#include <arpa/inet.h>
#include <zlib.h>
#ifndef __CYGWIN__
#include <arpa/nameser.h>
#else
#include "windows.h"
#endif
#ifdef DARWIN
#include <arpa/nameser8_compat.h>
#endif

View File

@ -36,11 +36,7 @@
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <zlib.h>
#ifndef __CYGWIN__
#include <arpa/nameser.h>
#else
#include "windows.h"
#endif
#ifdef DARWIN
#include <arpa/nameser8_compat.h>
#endif
@ -803,7 +799,6 @@ read_dns(int fd, struct query *q)
memcpy((struct sockaddr*)&q->from, (struct sockaddr*)&from, addrlen);
q->fromlen = addrlen;
#ifndef __CYGWIN__
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL;
cmsg = CMSG_NXTHDR(&msg, cmsg)) {
@ -814,7 +809,7 @@ read_dns(int fd, struct query *q)
break;
}
}
#endif
return strlen(q->name);
} else if (r < 0) {
/* Error */

View File

@ -1,49 +0,0 @@
#define T_A 1
#define T_NS 2
#define T_NULL 10
#define C_IN 1
#define NOERROR 0
#define SERVFAIL 2
#define NXDOMAIN 3
#define NOTIMP 4
#define REFUSED 5
typedef struct {
unsigned id :16; /* query identification number */
#if BYTE_ORDER == BIG_ENDIAN
/* fields in third byte */
unsigned qr: 1; /* response flag */
unsigned opcode: 4; /* purpose of message */
unsigned aa: 1; /* authoritive answer */
unsigned tc: 1; /* truncated message */
unsigned rd: 1; /* recursion desired */
/* fields in fourth byte */
unsigned ra: 1; /* recursion available */
unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
unsigned ad: 1; /* authentic data from named */
unsigned cd: 1; /* checking disabled by resolver */
unsigned rcode :4; /* response code */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
/* fields in third byte */
unsigned rd :1; /* recursion desired */
unsigned tc :1; /* truncated message */
unsigned aa :1; /* authoritive answer */
unsigned opcode :4; /* purpose of message */
unsigned qr :1; /* response flag */
/* fields in fourth byte */
unsigned rcode :4; /* response code */
unsigned cd: 1; /* checking disabled by resolver */
unsigned ad: 1; /* authentic data from named */
unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
unsigned ra :1; /* recursion available */
#endif
/* remaining bytes */
unsigned qdcount :16; /* number of question entries */
unsigned ancount :16; /* number of answer entries */
unsigned nscount :16; /* number of authority entries */
unsigned arcount :16; /* number of resource entries */
} HEADER;

View File

@ -23,5 +23,5 @@ $(TEST): $(OBJS) $(SRCOBJS)
clean:
@echo "Cleaning tests/"
@rm -f *~ *.core $(TEST){,exe} $(OBJS)
@rm -f *~ *.core $(TEST) $(OBJS)

View File

@ -23,11 +23,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/stat.h>
#ifndef __CYGWIN__
#include <arpa/nameser.h>
#else
#include "windows.h"
#endif
#include "common.h"
#include "dns.h"

View File

@ -18,11 +18,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/stat.h>
#ifndef __CYGWIN__
#include <arpa/nameser.h>
#else
#include "windows.h"
#endif
#ifdef DARWIN
#include <arpa/nameser8_compat.h>
#endif