diff options
author | Roland McGrath <roland@gnu.org> | 1992-11-09 23:27:41 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1992-11-09 23:27:41 +0000 |
commit | 888a9778616409ade58bc4b1d8c6bba223bafd3e (patch) | |
tree | b0a5897ccef20f32394c1754fdbcd1e71a3b3ecb /manual/examples | |
parent | 46ed3c64a14ed30a039eec55ebc9acbb8a523923 (diff) |
#include <stddef.h> for offsetof.
Removed unnecessary variable STATUS.
Diffstat (limited to 'manual/examples')
-rw-r--r-- | manual/examples/mkfsock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/manual/examples/mkfsock.c b/manual/examples/mkfsock.c index 45cd00adc2..8c09f32441 100644 --- a/manual/examples/mkfsock.c +++ b/manual/examples/mkfsock.c @@ -1,14 +1,15 @@ -#include <sys/socket.h> +#include <stddef.h> #include <stdio.h> -#include <sys/un.h> #include <errno.h> #include <stdlib.h> +#include <sys/socket.h> +#include <sys/un.h> int make_named_socket (const char *filename) { struct sockaddr_un name; - int sock, status; + int sock; size_t size; /* Create the socket. */ @@ -25,8 +26,7 @@ make_named_socket (const char *filename) name.sun_family = AF_FILE; strcpy (name.sun_path, filename); size = offsetof (name.sun_path) + strlen (name.sun_path) + 1; - status = bind (sock, (struct sockaddr *) &name, size); - if (status < 0) + if (bind (sock, (struct sockaddr *) &name, size) < 0) { perror ("bind"); exit (EXIT_FAILURE); |