summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-02-24 12:41:29 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-02-24 12:41:29 +0000
commitd5ba17f4cc03c8b1adcd764730d2074392f6588f (patch)
treec6ab0b117c532594e8d7491115caa41425f5366d /sbin
parentc19f32543e90475eadb46dfd40e9608571979088 (diff)
kill pidfile gunk
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c60
-rw-r--r--sbin/dhclient/dhcpd.h8
2 files changed, 16 insertions, 52 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 2eeffb46103..64e5d0c25c1 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.12 2004/02/24 12:34:26 henning Exp $ */
+/* $OpenBSD: dhclient.c,v 1.13 2004/02/24 12:41:28 henning Exp $ */
/* DHCP Client. */
@@ -79,7 +79,6 @@ struct tree_cache *global_options[256];
char *path_dhclient_conf = _PATH_DHCLIENT_CONF;
char *path_dhclient_db = _PATH_DHCLIENT_DB;
-char *path_dhclient_pid = _PATH_DHCLIENT_PID;
int interfaces_requested = 0;
@@ -96,25 +95,21 @@ struct sockaddr_in sockaddr_broadcast;
*/
#define ASSERT_STATE(state_is, state_shouldbe) {}
-u_int16_t local_port;
-u_int16_t remote_port;
-int log_priority;
-int no_daemon;
-int save_scripts;
-int onetry = 0;
-int unknown_ok = 1;
+u_int16_t local_port;
+u_int16_t remote_port;
+int log_priority;
+int no_daemon;
+int save_scripts;
+int onetry = 0;
+int unknown_ok = 1;
+int routefd;
-void usage(void);
+void usage(void);
+int check_option(struct client_lease *l, int option);
+int ipv4addrs(char * buf);
+int res_hnok(const char *dn);
+char *option_as_string(unsigned int code, unsigned char *data, int len);
-static int check_option(struct client_lease *l, int option);
-
-static int ipv4addrs(char * buf);
-
-static int res_hnok(const char *dn);
-
-char *option_as_string(unsigned int code, unsigned char *data, int len);
-
-int routefd;
struct interface_info *
isours(u_int16_t index)
@@ -2174,10 +2169,8 @@ go_daemon(void)
int pid;
/* Don't become a daemon if the user requested otherwise. */
- if (no_daemon) {
- write_client_pid_file();
+ if (no_daemon)
return;
- }
/* Only do it once. */
if (state)
@@ -2200,29 +2193,6 @@ go_daemon(void)
close(1);
close(2);
- write_client_pid_file();
-}
-
-void
-write_client_pid_file()
-{
- FILE *pf;
- int pfdesc;
-
- pfdesc = open(path_dhclient_pid, O_CREAT | O_TRUNC | O_WRONLY, 0644);
-
- if (pfdesc < 0) {
- warn("Can't create %s: %m", path_dhclient_pid);
- return;
- }
-
- pf = fdopen(pfdesc, "w");
- if (!pf)
- warn("Can't fdopen %s: %m", path_dhclient_pid);
- else {
- fprintf(pf, "%ld\n", (long)getpid());
- fclose(pf);
- }
}
int
diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h
index 72cf857999c..95a4dddf65f 100644
--- a/sbin/dhclient/dhcpd.h
+++ b/sbin/dhclient/dhcpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpd.h,v 1.10 2004/02/23 20:16:00 henning Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.11 2004/02/24 12:41:28 henning Exp $ */
/* Definitions for dhcpd... */
@@ -424,12 +424,8 @@ typedef unsigned char option_mask[16];
/* Default path to dhcpd config file. */
#define _PATH_DHCLIENT_CONF "/etc/dhclient.conf"
-#define _PATH_DHCLIENT_PID "/var/run/dhclient.pid"
#define _PATH_DHCLIENT_DB "/var/db/dhclient.leases"
#define _PATH_RESOLV_CONF "/etc/resolv.conf"
-#define _PATH_DHCRELAY_PID "/var/run/dhcrelay.pid"
-#define _PATH_DHCLIENT_PID "/var/run/dhclient.pid"
-#define _PATH_DHCLIENT_DB "/var/db/dhclient.leases"
#define DHCPD_LOG_FACILITY LOG_DAEMON
#define MAX_TIME 0x7fffffff
@@ -605,7 +601,6 @@ char *piaddr(struct iaddr);
/* dhclient.c */
extern char *path_dhclient_conf;
extern char *path_dhclient_db;
-extern char *path_dhclient_pid;
extern int interfaces_requested;
extern time_t cur_time;
extern u_int16_t local_port;
@@ -654,7 +649,6 @@ int dhcp_option_ev_name(char *, size_t, struct option *);
struct client_lease *packet_to_lease(struct packet *);
void go_daemon(void);
-void write_client_pid_file(void);
void client_location_changed(void);
void bootp(struct packet *);