masqmail

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 diff
     1.1 --- a/src/libident/id_query.c	Mon Oct 27 16:21:27 2008 +0100
     1.2 +++ b/src/libident/id_query.c	Mon Oct 27 16:23:10 2008 +0100
     1.3 @@ -30,59 +30,53 @@
     1.4  #  include <sys/select.h>
     1.5  #endif
     1.6  #ifdef VMS
     1.7 -#  include <sys/socket.h>     /* for fd_set */
     1.8 +#  include <sys/socket.h>  /* for fd_set */
     1.9  #endif
    1.10  #define IN_LIBIDENT_SRC
    1.11  #include "ident.h"
    1.12  
    1.13  
    1.14  /*
    1.15 -int id_query __P4(ident_t *, id,
    1.16 -		  int, lport,
    1.17 -		  int, fport,
    1.18 -		  struct timeval *, timeout)
    1.19 +int
    1.20 +id_query __P4(ident_t *, id, int, lport, int, fport, struct timeval *, timeout)
    1.21  */
    1.22  
    1.23 -int    id_query __P((	ident_t *id,                 
    1.24 -			int lport,                   
    1.25 -			int fport,                   
    1.26 -			__STRUCT_TIMEVAL_P timeout))
    1.27 +int
    1.28 +id_query __P((ident_t * id, int lport, int fport, __STRUCT_TIMEVAL_P timeout))
    1.29  {
    1.30  #ifdef SIGRETURNTYPE
    1.31 -    SIGRETURNTYPE (*old_sig)();
    1.32 +	SIGRETURNTYPE(*old_sig) ();
    1.33  #else
    1.34 -    void (*old_sig) __P((int));
    1.35 +	void (*old_sig) __P((int));
    1.36  #endif
    1.37 -    int res;
    1.38 -    char buf[80];
    1.39 -    fd_set ws;
    1.40 -    
    1.41 -    sprintf(buf, "%d , %d\r\n", lport, fport);
    1.42 -    
    1.43 -    if (timeout)
    1.44 -    {
    1.45 -	FD_ZERO(&ws);
    1.46 -	FD_SET(id->fd, &ws);
    1.47 +	int res;
    1.48 +	char buf[80];
    1.49 +	fd_set ws;
    1.50 +
    1.51 +	sprintf(buf, "%d , %d\r\n", lport, fport);
    1.52 +
    1.53 +	if (timeout) {
    1.54 +		FD_ZERO(&ws);
    1.55 +		FD_SET(id->fd, &ws);
    1.56  
    1.57  #ifdef __hpux
    1.58 -	if ((res = select(FD_SETSIZE, (int *)0, (int *)&ws, (int *)0, timeout)) < 0)
    1.59 +		if ((res = select(FD_SETSIZE, (int *) 0, (int *) &ws, (int *) 0, timeout)) < 0)
    1.60  #else
    1.61 -	if ((res = select(FD_SETSIZE, (fd_set *)0, &ws, (fd_set *)0, timeout)) < 0)
    1.62 +		if ((res = select(FD_SETSIZE, (fd_set *) 0, &ws, (fd_set *) 0, timeout)) < 0)
    1.63  #endif
    1.64 -	    return -1;
    1.65 -	
    1.66 -	if (res == 0)
    1.67 -	{
    1.68 -	    errno = ETIMEDOUT;
    1.69 -	    return -1;
    1.70 +			return -1;
    1.71 +
    1.72 +		if (res == 0) {
    1.73 +			errno = ETIMEDOUT;
    1.74 +			return -1;
    1.75 +		}
    1.76  	}
    1.77 -    }
    1.78  
    1.79 -    old_sig = signal(SIGPIPE, SIG_IGN);
    1.80 -    
    1.81 -    res = write(id->fd, buf, strlen(buf));
    1.82 -    
    1.83 -    signal(SIGPIPE, old_sig);
    1.84 -    
    1.85 -    return res;
    1.86 +	old_sig = signal(SIGPIPE, SIG_IGN);
    1.87 +
    1.88 +	res = write(id->fd, buf, strlen(buf));
    1.89 +
    1.90 +	signal(SIGPIPE, old_sig);
    1.91 +
    1.92 +	return res;
    1.93  }