svn rev #21746: trunk/src/ kadmin/server/ kdc/
raeburn@MIT.EDU
raeburn at MIT.EDU
Wed Jan 14 15:05:12 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=21746
Commit By: raeburn
Log Message:
Merge some very simple points of divergence in the two copies of network.c -- enum ordering, whitespace,
duplicate macro definitions, unused code, 0 vs NULL...
Changed Files:
U trunk/src/kadmin/server/network.c
U trunk/src/kdc/network.c
Modified: trunk/src/kadmin/server/network.c
===================================================================
--- trunk/src/kadmin/server/network.c 2009-01-14 19:50:34 UTC (rev 21745)
+++ trunk/src/kadmin/server/network.c 2009-01-14 20:05:09 UTC (rev 21746)
@@ -1,7 +1,7 @@
/*
* kadmin/server/network.c
*
- * Copyright 1990,2000,2007,2008 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2000,2007,2008,2009 by the Massachusetts Institute of Technology.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
@@ -180,13 +180,16 @@
/* kadmin data. */
-enum kadm_conn_type { CONN_UDP, CONN_UDP_PKTINFO, CONN_TCP_LISTENER,
- CONN_TCP, CONN_ROUTING, CONN_RPC_LISTENER, CONN_RPC };
+enum conn_type {
+ CONN_UDP, CONN_UDP_PKTINFO, CONN_TCP_LISTENER, CONN_TCP,
+ CONN_RPC_LISTENER, CONN_RPC,
+ CONN_ROUTING
+};
/* Per-connection info. */
struct connection {
int fd;
- enum kadm_conn_type type;
+ enum conn_type type;
void (*service)(void *handle, struct connection *, const char *, int);
union {
/* Type-specific information. */
@@ -334,10 +337,6 @@
#define USE_AF AF_INET
#define USE_TYPE SOCK_DGRAM
-
-
-#define USE_AF AF_INET
-#define USE_TYPE SOCK_DGRAM
#define USE_PROTO 0
#define SOCKET_ERRNO errno
#include "foreachaddr.h"
@@ -351,7 +350,7 @@
};
static struct connection *
-add_fd (struct socksetup *data, int sock, enum kadm_conn_type conntype,
+add_fd (struct socksetup *data, int sock, enum conn_type conntype,
void (*service)(void *handle, struct connection *, const char *, int))
{
struct connection *newconn;
Modified: trunk/src/kdc/network.c
===================================================================
--- trunk/src/kdc/network.c 2009-01-14 19:50:34 UTC (rev 21745)
+++ trunk/src/kdc/network.c 2009-01-14 20:05:09 UTC (rev 21746)
@@ -1,7 +1,7 @@
/*
* kdc/network.c
*
- * Copyright 1990,2000,2007,2008 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2000,2007,2008,2009 by the Massachusetts Institute of Technology.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
@@ -175,27 +175,19 @@
/* KDC data. */
-enum kdc_conn_type { CONN_UDP, CONN_UDP_PKTINFO, CONN_TCP_LISTENER, CONN_TCP, CONN_ROUTING };
+enum conn_type {
+ CONN_UDP, CONN_UDP_PKTINFO, CONN_TCP_LISTENER, CONN_TCP,
+ CONN_ROUTING
+};
/* Per-connection info. */
struct connection {
int fd;
- enum kdc_conn_type type;
+ enum conn_type type;
void (*service)(struct connection *, const char *, int);
union {
/* Type-specific information. */
-#if 0
struct {
- int x;
- } udp;
- struct {
- int x;
- } udp_pktinfo;
- struct {
- int x;
- } tcp_listener;
-#endif
- struct {
/* connection */
struct sockaddr_storage addr_s;
socklen_t addrlen;
@@ -316,7 +308,7 @@
};
static struct connection *
-add_fd (struct socksetup *data, int sock, enum kdc_conn_type conntype,
+add_fd (struct socksetup *data, int sock, enum conn_type conntype,
void (*service)(struct connection *, const char *, int))
{
struct connection *newconn;
@@ -527,7 +519,7 @@
/* Sockets are created, prepare to listen on them. */
if (s4 >= 0) {
- if (add_tcp_listener_fd(data, s4) == 0)
+ if (add_tcp_listener_fd(data, s4) == NULL)
close(s4);
else {
FD_SET(s4, &sstate.rfds);
@@ -539,7 +531,7 @@
}
#ifdef KRB5_USE_INET6
if (s6 >= 0) {
- if (add_tcp_listener_fd(data, s6) == 0) {
+ if (add_tcp_listener_fd(data, s6) == NULL) {
close(s6);
s6 = -1;
} else {
@@ -1306,7 +1298,7 @@
sockdata.retval = 0;
newconn = add_tcp_data_fd(&sockdata, s);
- if (newconn == 0)
+ if (newconn == NULL)
return;
if (getnameinfo((struct sockaddr *)&addr_s, addrlen,
More information about the cvs-krb5
mailing list