diff src/libident/id_query.c @ 10:26e34ae9a3e3

changed indention and line wrapping to a more consistent style
author meillo@marmaro.de
date Mon, 27 Oct 2008 16:23:10 +0100
parents 08114f7dcc23
children
line wrap: on
line diff
--- a/src/libident/id_query.c	Mon Oct 27 16:21:27 2008 +0100
+++ b/src/libident/id_query.c	Mon Oct 27 16:23:10 2008 +0100
@@ -30,59 +30,53 @@
 #  include <sys/select.h>
 #endif
 #ifdef VMS
-#  include <sys/socket.h>     /* for fd_set */
+#  include <sys/socket.h>  /* for fd_set */
 #endif
 #define IN_LIBIDENT_SRC
 #include "ident.h"
 
 
 /*
-int id_query __P4(ident_t *, id,
-		  int, lport,
-		  int, fport,
-		  struct timeval *, timeout)
+int
+id_query __P4(ident_t *, id, int, lport, int, fport, struct timeval *, timeout)
 */
 
-int    id_query __P((	ident_t *id,                 
-			int lport,                   
-			int fport,                   
-			__STRUCT_TIMEVAL_P timeout))
+int
+id_query __P((ident_t * id, int lport, int fport, __STRUCT_TIMEVAL_P timeout))
 {
 #ifdef SIGRETURNTYPE
-    SIGRETURNTYPE (*old_sig)();
+	SIGRETURNTYPE(*old_sig) ();
 #else
-    void (*old_sig) __P((int));
+	void (*old_sig) __P((int));
 #endif
-    int res;
-    char buf[80];
-    fd_set ws;
-    
-    sprintf(buf, "%d , %d\r\n", lport, fport);
-    
-    if (timeout)
-    {
-	FD_ZERO(&ws);
-	FD_SET(id->fd, &ws);
+	int res;
+	char buf[80];
+	fd_set ws;
+
+	sprintf(buf, "%d , %d\r\n", lport, fport);
+
+	if (timeout) {
+		FD_ZERO(&ws);
+		FD_SET(id->fd, &ws);
 
 #ifdef __hpux
-	if ((res = select(FD_SETSIZE, (int *)0, (int *)&ws, (int *)0, timeout)) < 0)
+		if ((res = select(FD_SETSIZE, (int *) 0, (int *) &ws, (int *) 0, timeout)) < 0)
 #else
-	if ((res = select(FD_SETSIZE, (fd_set *)0, &ws, (fd_set *)0, timeout)) < 0)
+		if ((res = select(FD_SETSIZE, (fd_set *) 0, &ws, (fd_set *) 0, timeout)) < 0)
 #endif
-	    return -1;
-	
-	if (res == 0)
-	{
-	    errno = ETIMEDOUT;
-	    return -1;
+			return -1;
+
+		if (res == 0) {
+			errno = ETIMEDOUT;
+			return -1;
+		}
 	}
-    }
+
+	old_sig = signal(SIGPIPE, SIG_IGN);
+
+	res = write(id->fd, buf, strlen(buf));
 
-    old_sig = signal(SIGPIPE, SIG_IGN);
-    
-    res = write(id->fd, buf, strlen(buf));
-    
-    signal(SIGPIPE, old_sig);
-    
-    return res;
+	signal(SIGPIPE, old_sig);
+
+	return res;
 }