diff options
author | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:34:30 -0500 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:34:30 -0500 |
commit | e5a951325a6cac8567af3a66de6d2df577508ae4 (patch) | |
tree | 34da9fe59f3c2d7f8edb072144443a9704197831 /source3/tests/unixsock.c | |
parent | 57482469b32645250e92a7ffd003aeeb4a42235e (diff) | |
download | samba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.gz samba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.bz2 samba-e5a951325a6cac8567af3a66de6d2df577508ae4.zip |
[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
Diffstat (limited to 'source3/tests/unixsock.c')
-rw-r--r-- | source3/tests/unixsock.c | 21 |
1 files changed, 9 insertions, 12 deletions
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 <mbp@samba.org>, June 2000. - */ + * Coding standard says to always use exit() for this, not return, so + * we do. + * + * Martin Pool <mbp@samba.org>, June 2000. */ /* TODO: Look for AF_LOCAL (most standard), AF_UNIX, and AF_FILE. */ #include <stdio.h> -#if defined(HAVE_UNISTD_H) -#include <unistd.h> -#endif - #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #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); } |