Fix a compile problem
[oweals/busybox.git] / networking / udhcp / common.c
index bfdc7ba8d7b32e87b118f049d0a1238310dd263d..c5a24fc62f9af65eda728dac88e0e856ddbe48d6 100644 (file)
@@ -4,7 +4,7 @@
  * simple helper functions.
  *
  * Russ Dill <Russ.Dill@asu.edu> 2001-2003
- * Rewrited by Vladimir Oleynik <dzo@simtreas.ru> (C) 2003
+ * Rewritten by Vladimir Oleynik <dzo@simtreas.ru> (C) 2003
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 static int daemonized;
 
+long uptime(void)
+{
+       struct sysinfo info;
+       sysinfo(&info);
+       printf("uptime %ld\n", (long)info.uptime);
+       return info.uptime;
+}
+
 
 /*
  * This function makes sure our first socket calls
@@ -55,13 +63,12 @@ static inline void sanitize_fds(void)
 void background(const char *pidfile)
 {
 #ifdef __uClinux__
-       LOG(LOG_ERR, "Cannot background in uclinux (yet)");     
+       LOG(LOG_ERR, "Cannot background in uclinux (yet)");
 #else /* __uClinux__ */
        int pid_fd;
 
-       if (!pidfile) return;
-
-       pid_fd = pidfile_acquire(pidfile); /* hold lock during fork. */
+       /* hold lock during fork. */
+       pid_fd = pidfile_acquire(pidfile);
        if (daemon(0, 0) == -1) {
                perror("fork");
                exit(1);