From e5a951325a6cac8567af3a66de6d2df577508ae4 Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Wed, 10 Oct 2007 15:34:30 -0500 Subject: [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab) --- source3/tests/unixsock.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'source3/tests/unixsock.c') diff --git a/source3/tests/unixsock.c b/source3/tests/unixsock.c index ba384ae362..f2765d68f6 100644 --- a/source3/tests/unixsock.c +++ b/source3/tests/unixsock.c @@ -1,5 +1,4 @@ -/* - * -*- c-file-style: "linux" -*- +/* -*- c-file-style: "linux" -*- * * Try creating a Unix-domain socket, opening it, and reading from it. * The POSIX name for these is AF_LOCAL/PF_LOCAL. @@ -9,17 +8,15 @@ * on which they are broken under some conditions, such as RedHat 7.0 * (unpatched). We can't build WinBind there at the moment. * - * Martin Pool , June 2000. - */ + * Coding standard says to always use exit() for this, not return, so + * we do. + * + * Martin Pool , June 2000. */ /* TODO: Look for AF_LOCAL (most standard), AF_UNIX, and AF_FILE. */ #include -#if defined(HAVE_UNISTD_H) -#include -#endif - #ifdef HAVE_SYS_SOCKET_H # include #endif @@ -51,7 +48,7 @@ static int bind_socket(char const *filename) /* Create the socket. */ if ((sock_fd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) { perror ("socket(PF_LOCAL, SOCK_STREAM)"); - return 1; + exit(1); } /* Bind a name to the socket. */ @@ -70,7 +67,7 @@ static int bind_socket(char const *filename) if (bind(sock_fd, (struct sockaddr *) &name, size) < 0) { perror ("bind"); - return 1; + exit(1); } return sock_fd; @@ -87,10 +84,10 @@ int main(void) alarm(15); /* secs */ if ((sock_fd = bind_socket(filename)) < 0) - return 1; + exit(1); /* the socket will be deleted when autoconf cleans up these files. */ - return 0; + exit(0); } -- cgit