unixif: fixed unused variable warning, replaced tabs with spaces

This commit is contained in:
Simon Goldschmidt 2012-03-01 19:15:38 +01:00
parent 600b8665a5
commit 5b1bd88115

View File

@ -83,7 +83,10 @@ struct unixif {
static int
unix_socket_client(const char *name)
{
int fd, len;
int fd;
#if !defined(linux) && !defined(cygwin) && !defined(__CYGWIN__)
int len;
#endif
struct sockaddr_un unix_addr;
/* create a Unix domain stream socket */
@ -100,9 +103,6 @@ unix_socket_client(const char *name)
len = sizeof(unix_addr.sun_len) + sizeof(unix_addr.sun_family) +
strlen(unix_addr.sun_path) + 1;
unix_addr.sun_len = len;
#else
len = sizeof(unix_addr.sun_family) +
strlen(unix_addr.sun_path) + 1;
#endif /* linux */
unlink(unix_addr.sun_path); /* in case it already exists */
@ -124,8 +124,6 @@ unix_socket_client(const char *name)
len = sizeof(unix_addr.sun_len) + sizeof(unix_addr.sun_family) +
strlen(unix_addr.sun_path) + 1;
unix_addr.sun_len = len;
#else
len = sizeof(unix_addr.sun_family) + strlen(unix_addr.sun_path) + 1;
#endif /* linux */
if (connect(fd, (struct sockaddr *) &unix_addr,
sizeof(struct sockaddr_un)) < 0) {
@ -139,7 +137,10 @@ unix_socket_client(const char *name)
static int
unix_socket_server(const char *name)
{
int fd, len;
int fd;
#if !defined(linux) && !defined(cygwin) && !defined(__CYGWIN__)
int len;
#endif
struct sockaddr_un unix_addr;
/* create a Unix domain stream socket */
@ -158,9 +159,6 @@ unix_socket_server(const char *name)
len = sizeof(unix_addr.sun_len) + sizeof(unix_addr.sun_family) +
strlen(unix_addr.sun_path) + 1;
unix_addr.sun_len = len;
#else
len = sizeof(unix_addr.sun_family) +
strlen(unix_addr.sun_path) + 1;
#endif /* linux */
/* bind the name to the descriptor */