summaryrefslogtreecommitdiff
path: root/libexec/identd/identd.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-08-09 22:59:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-08-09 22:59:11 +0000
commitb980b74f83a52e777efcf8f5bfefc61d0e42c56c (patch)
treef3e495d3e645e0d343274934c1b5454a234c877d /libexec/identd/identd.c
parenta065e364ab922f838f31c8f0f37884ec53df8e4d (diff)
Using stdio on sockets is gross so don't do it. Also some -Wall.
Diffstat (limited to 'libexec/identd/identd.c')
-rw-r--r--libexec/identd/identd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libexec/identd/identd.c b/libexec/identd/identd.c
index 67332176087..708888db449 100644
--- a/libexec/identd/identd.c
+++ b/libexec/identd/identd.c
@@ -6,12 +6,14 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <netdb.h>
#include <signal.h>
#include <fcntl.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
@@ -264,7 +266,7 @@ main(argc, argv)
addr.sin_port = sp->s_port;
}
- if (bind(0, (struct sockaddr *) & addr, sizeof(addr)) < 0)
+ if (bind(0, (struct sockaddr *) &addr, sizeof(addr)) < 0)
ERROR("main: bind");
if (listen(0, 3) < 0)
@@ -364,7 +366,7 @@ main(argc, argv)
* Get foreign internet address
*/
len = sizeof(sin);
- if (getpeername(0, (struct sockaddr *) & sin, &len) == -1) {
+ if (getpeername(0, (struct sockaddr *) &sin, &len) == -1) {
/*
* A user has tried to start us from the command line or
* the network link died, in which case this message won't
@@ -391,7 +393,7 @@ main(argc, argv)
* Get local internet address
*/
len = sizeof(sin);
- if (getsockname(0, (struct sockaddr *) & sin, &len) == -1) {
+ if (getsockname(0, (struct sockaddr *) &sin, &len) == -1) {
/*
* We can just die here, because if this fails then the
* network has died and we haven't got anyone to return
@@ -404,6 +406,6 @@ main(argc, argv)
/*
* Get the local/foreign port pair from the luser
*/
- parse(stdin, &laddr, &faddr);
+ parse(STDIN_FILENO, &laddr, &faddr);
exit(0);
}