summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-04-12 21:33:16 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-04-12 21:33:16 +0000
commit6758b73e1ea2f23858aeb2ea1489ad2b7e4fb1f7 (patch)
tree9e302ec15b6a259160443a34e592479282c8e91d /usr.sbin
parent489288813cec48ccf914f95024260ceb292bc7c2 (diff)
kill pidfile gunk
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dhcrelay/dhcrelay.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/usr.sbin/dhcrelay/dhcrelay.c b/usr.sbin/dhcrelay/dhcrelay.c
index 8c7e47bfa40..3d2a1214c32 100644
--- a/usr.sbin/dhcrelay/dhcrelay.c
+++ b/usr.sbin/dhcrelay/dhcrelay.c
@@ -54,16 +54,6 @@ struct tree_cache *global_options [256];
int log_perror = 1;
-/* Needed to prevent linking against conflex.c. */
-#if 0
-int lexline;
-int lexchar;
-char *token_line;
-char *tlname;
-#endif
-
-char *path_dhcrelay_pid = "/var/run/dhcrelay.pid";
-
u_int16_t local_port;
u_int16_t remote_port;
int log_priority;
@@ -103,10 +93,6 @@ int main (argc, argv)
local_port = htons (atoi (argv [i]));
debug ("binding to user-specified port %d",
ntohs (local_port));
- } else if (!strcmp (argv [i], "-pf")) {
- if (++i == argc)
- usage();
- path_dhcrelay_pid = argv [i];
} else if (!strcmp (argv [i], "-d")) {
no_daemon = 1;
} else if (!strcmp (argv [i], "-i")) {
@@ -189,8 +175,6 @@ int main (argc, argv)
/* Become a daemon... */
if (!no_daemon) {
int pid;
- FILE *pf;
- int pfdesc;
log_perror = 0;
@@ -199,22 +183,6 @@ int main (argc, argv)
else if (pid)
exit (0);
- pfdesc = open (path_dhcrelay_pid,
- O_CREAT | O_TRUNC | O_WRONLY, 0644);
-
- if (pfdesc < 0) {
- warn ("Can't create %s: %m", path_dhcrelay_pid);
- } else {
- pf = fdopen (pfdesc, "w");
- if (!pf)
- warn ("Can't fdopen %s: %m",
- path_dhcrelay_pid);
- else {
- fprintf (pf, "%ld\n", (long)getpid ());
- fclose (pf);
- }
- }
-
close (0);
close (1);
close (2);
@@ -326,8 +294,8 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "Usage: %s [-q] [-d] [-p <port>]", __progname);
- fprintf(stderr, "server1 [... serverN]\n");
+ fprintf(stderr, "Usage: %s [-q] [-d] [-p <port>] ", __progname);
+ fprintf(stderr, "-i interface server1 [... serverN]\n");
exit (1);
}