summaryrefslogtreecommitdiff
path: root/networking/udhcp/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/common.c')
-rw-r--r--networking/udhcp/common.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 76f8bf7..108ab2e 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -10,31 +10,10 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <syslog.h>
-
#include "common.h"
-
const uint8_t MAC_BCAST_ADDR[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-long uptime(void)
-{
- struct sysinfo info;
- sysinfo(&info);
- return info.uptime;
-}
-
-static void create_pidfile(const char *pidfile)
-{
- if (!pidfile)
- return;
-
- if (!write_pidfile(pidfile)) {
- bb_perror_msg("cannot create pidfile %s", pidfile);
- return;
- }
-}
-
void udhcp_make_pidfile(const char *pidfile)
{
/* Make sure fd 0,1,2 are open */
@@ -44,7 +23,8 @@ void udhcp_make_pidfile(const char *pidfile)
setlinebuf(stdout);
/* Create pidfile */
- create_pidfile(pidfile);
+ if (pidfile && !write_pidfile(pidfile))
+ bb_perror_msg("cannot create pidfile %s", pidfile);
bb_info_msg("%s (v%s) started", applet_name, BB_VER);
}