diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index c97e422..4612c41 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -19,9 +19,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  
-#include <stdio.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/file.h>
 #include <unistd.h>
 #include <getopt.h>
@@ -40,11 +38,9 @@
 #include "dhcpc.h"
 #include "options.h"
 #include "clientpacket.h"
-#include "packet.h"
 #include "script.h"
 #include "socket.h"
-#include "debug.h"
-#include "pidfile.h"
+#include "common.h"
 
 static int state;
 static unsigned long requested_ip; /* = 0 */
@@ -52,7 +48,6 @@
 static unsigned long timeout;
 static int packet_num; /* = 0 */
 static int fd = -1;
-static int signal_pipe[2];
 
 #define LISTEN_NONE 0
 #define LISTEN_KERNEL 1
@@ -80,34 +75,6 @@
 	arp: "\0\0\0\0\0\0",		/* appease gcc-3.0 */
 };
 
-#ifndef IN_BUSYBOX
-static void __attribute__ ((noreturn)) bb_show_usage(void)
-{
-	printf(
-"Usage: udhcpc [OPTIONS]\n\n"
-"  -c, --clientid=CLIENTID         Client identifier\n"
-"  -H, --hostname=HOSTNAME         Client hostname\n"
-"  -h                              Alias for -H\n"
-"  -f, --foreground                Do not fork after getting lease\n"
-"  -b, --background                Fork to background if lease cannot be\n"
-"                                  immediately negotiated.\n"
-"  -i, --interface=INTERFACE       Interface to use (default: eth0)\n"
-"  -n, --now                       Exit with failure if lease cannot be\n"
-"                                  immediately negotiated.\n"
-"  -p, --pidfile=file              Store process ID of daemon in file\n"
-"  -q, --quit                      Quit after obtaining lease\n"
-"  -r, --request=IP                IP address to request (default: none)\n"
-"  -s, --script=file               Run file at dhcp events (default:\n"
-"                                  " DEFAULT_SCRIPT ")\n"
-"  -v, --version                   Display version\n"
-	);
-	exit(0);
-}
-#else
-extern void bb_show_usage(void) __attribute__ ((noreturn));
-#endif
-
-
 /* just a little helper */
 static void change_mode(int new_mode)
 {
@@ -172,46 +139,15 @@
 }
 
 
-/* Exit and cleanup */
-static void exit_client(int retval)
+static void client_background(void)
 {
-	pidfile_delete(client_config.pidfile);
-	CLOSE_LOG();
-	exit(retval);
-}
-
-
-/* Signal handler */
-static void signal_handler(int sig)
-{
-	if (send(signal_pipe[1], &sig, sizeof(sig), MSG_DONTWAIT) < 0) {
-		LOG(LOG_ERR, "Could not send signal: %s",
-			strerror(errno));
-	}
-}
-
-
-static void background(void)
-{
-	int pid_fd;
-
-	pid_fd = pidfile_acquire(client_config.pidfile); /* hold lock during fork. */
-	while (pid_fd >= 0 && pid_fd < 3) pid_fd = dup(pid_fd); /* don't let daemon close it */
-	if (daemon(0, 0) == -1) {
-		perror("fork");
-		exit_client(1);
-	}
+	background(client_config.pidfile);
 	client_config.foreground = 1; /* Do not fork again. */
 	client_config.background_if_no_lease = 0;
-	pidfile_write_release(pid_fd);
 }
 
 
-#ifdef COMBINED_BINARY
 int udhcpc_main(int argc, char *argv[])
-#else
-int main(int argc, char *argv[])
-#endif
 {
 	unsigned char *temp, *message;
 	unsigned long t1 = 0, t2 = 0, xid = 0;
@@ -222,12 +158,11 @@
 	int c, len;
 	struct dhcpMessage packet;
 	struct in_addr temp_addr;
-	int pid_fd;
 	time_t now;
 	int max_fd;
 	int sig;
 
-	static struct option arg_options[] = {
+	static const struct option arg_options[] = {
 		{"clientid",	required_argument,	0, 'c'},
 		{"foreground",	no_argument,		0, 'f'},
 		{"background",	no_argument,		0, 'b'},
@@ -240,7 +175,6 @@
 		{"request",	required_argument,	0, 'r'},
 		{"script",	required_argument,	0, 's'},
 		{"version",	no_argument,		0, 'v'},
-		{"help",	no_argument,		0, '?'},
 		{0, 0, 0, 0}
 	};
 
@@ -294,23 +228,18 @@
 			client_config.script = optarg;
 			break;
 		case 'v':
-			printf("udhcpcd, version %s\n\n", VERSION);
-			exit_client(0);
+			bb_error_msg("version %s\n", VERSION);
+			return(0);
 			break;
 		default:
 			bb_show_usage();
 		}
 	}
 
-	OPEN_LOG("udhcpc");
-	LOG(LOG_INFO, "udhcp client (v%s) started", VERSION);
-
-	pid_fd = pidfile_acquire(client_config.pidfile);
-	pidfile_write_release(pid_fd);
-
+	start_log("client");
 	if (read_interface(client_config.interface, &client_config.ifindex, 
 			   NULL, client_config.arp) < 0)
-		exit_client(1);
+		return(1);
 		
 	if (!client_config.clientid) {
 		client_config.clientid = xmalloc(6 + 3);
@@ -321,10 +250,7 @@
 	}
 
 	/* setup signal handlers */
-	socketpair(AF_UNIX, SOCK_STREAM, 0, signal_pipe);
-	signal(SIGUSR1, signal_handler);
-	signal(SIGUSR2, signal_handler);
-	signal(SIGTERM, signal_handler);
+	udhcp_set_signal_pipe(SIGUSR2);
 	
 	state = INIT_SELECTING;
 	run_script(NULL, "deconfig");
@@ -342,16 +268,16 @@
 			else
 				fd = raw_socket(client_config.ifindex);
 			if (fd < 0) {
-				LOG(LOG_ERR, "FATAL: couldn't listen on socket, %s", strerror(errno));
-				exit_client(0);
+				LOG(LOG_ERR, "FATAL: couldn't listen on socket, %m");
+				return(0);
 			}
 		}
 		if (fd >= 0) FD_SET(fd, &rfds);
-		FD_SET(signal_pipe[0], &rfds);		
+		FD_SET(udhcp_signal_pipe[0], &rfds);
 
 		if (tv.tv_sec > 0) {
 			DEBUG(LOG_INFO, "Waiting on select...\n");
-			max_fd = signal_pipe[0] > fd ? signal_pipe[0] : fd;
+			max_fd = udhcp_signal_pipe[0] > fd ? udhcp_signal_pipe[0] : fd;
 			retval = select(max_fd + 1, &rfds, NULL, NULL, &tv);
 		} else retval = 0; /* If we already timed out, fall through */
 
@@ -372,10 +298,10 @@
 				} else {
 					if (client_config.background_if_no_lease) {
 						LOG(LOG_INFO, "No lease, forking to background.");
-						background();
+						client_background();
 					} else if (client_config.abort_if_no_lease) {
 						LOG(LOG_INFO, "No lease, failing.");
-						exit_client(1);
+						return(1);
 				  	}
 					/* wait to try again */
 					packet_num = 0;
@@ -453,7 +379,7 @@
 			else len = get_raw_packet(&packet, fd);
 			
 			if (len == -1 && errno != EINTR) {
-				DEBUG(LOG_INFO, "error on read, %s, reopening socket", strerror(errno));
+				DEBUG(LOG_INFO, "error on read, %m, reopening socket");
 				change_mode(listen_mode); /* just close and reopen */
 			}
 			if (len < 0) continue;
@@ -517,9 +443,9 @@
 					state = BOUND;
 					change_mode(LISTEN_NONE);
 					if (client_config.quit_after_lease) 
-						exit_client(0);
+						return(0);
 					if (!client_config.foreground)
-						background();
+						client_background();
 
 				} else if (*message == DHCPNAK) {
 					/* return to init state */
@@ -537,10 +463,9 @@
 				break;
 			/* case BOUND, RELEASED: - ignore all packets */
 			}	
-		} else if (retval > 0 && FD_ISSET(signal_pipe[0], &rfds)) {
-			if (read(signal_pipe[0], &sig, sizeof(sig)) < 0) {
-				DEBUG(LOG_ERR, "Could not read signal: %s", 
-					strerror(errno));
+		} else if (retval > 0 && FD_ISSET(udhcp_signal_pipe[0], &rfds)) {
+			if (read(udhcp_signal_pipe[0], &sig, sizeof(sig)) < 0) {
+				DEBUG(LOG_ERR, "Could not read signal: %m");
 				continue; /* probably just EINTR */
 			}
 			switch (sig) {
@@ -552,7 +477,7 @@
 				break;
 			case SIGTERM:
 				LOG(LOG_INFO, "Received SIGTERM");
-				exit_client(0);
+				return(0);
 			}
 		} else if (retval == -1 && errno == EINTR) {
 			/* a signal was caught */		
@@ -564,4 +489,3 @@
 	}
 	return 0;
 }
-
