diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-10-13 01:53:15 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-10-13 01:53:15 +0000 |
commit | 1cd11ef94226451701b8237c1bf27fafdc8f827f (patch) | |
tree | c1e9a90daba5b28903f7ac05f0a09c421492e9fb /usr.sbin/inetd/inetd.c | |
parent | 7a530fef6512a5e6d80a075c07451756a14d0c37 (diff) |
dont need to store the same debug flag in two separate variables.
ok millert@ deraadt@
Diffstat (limited to 'usr.sbin/inetd/inetd.c')
-rw-r--r-- | usr.sbin/inetd/inetd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index d9fb538dd1c..5863c7ae052 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inetd.c,v 1.140 2014/10/12 09:36:42 dlg Exp $ */ +/* $OpenBSD: inetd.c,v 1.141 2014/10/13 01:53:14 dlg Exp $ */ /* * Copyright (c) 1983,1991 The Regents of the University of California. @@ -162,7 +162,6 @@ int nsock, maxsock; fd_set *allsockp; int allsockn; int toomany = TOOMANY; -int options; int timingout; struct servent *sp; uid_t uid; @@ -330,7 +329,6 @@ main(int argc, char *argv[]) switch (ch) { case 'd': debug = 1; - options |= SO_DEBUG; break; case 'R': { /* invocation rate */ char *p; @@ -962,7 +960,7 @@ setup(struct servtab *sep) } #define turnon(fd, opt) \ setsockopt(fd, SOL_SOCKET, opt, &on, sizeof (on)) - if (strncmp(sep->se_proto, "tcp", 3) == 0 && (options & SO_DEBUG) && + if (strncmp(sep->se_proto, "tcp", 3) == 0 && debug && turnon(sep->se_fd, SO_DEBUG) < 0) syslog(LOG_ERR, "setsockopt (SO_DEBUG): %m"); if (turnon(sep->se_fd, SO_REUSEADDR) < 0) |