Remember to delete un-expandable variables, and do a better job of expanding
[oweals/busybox.git] / update.c
index 7279d83a87981c3d47ddd370c76b597d41080600..b282b9e18aa9659dfb4a05654c44b01d6b339286 100644 (file)
--- a/update.c
+++ b/update.c
  * earlier) kernel. 2.2.x and higher flush filesystem buffers automatically.
  */
 
-#include "busybox.h"
 #include <sys/param.h>
 #include <sys/syslog.h>
 #include <unistd.h> /* for getopt() */
+#include <stdlib.h>
 
 
 #if defined(__GLIBC__)
 #include <sys/kdaemon.h>
 #else
+#include <sys/syscall.h>
+#include <linux/unistd.h>
 static _syscall2(int, bdflush, int, func, int, data);
 #endif /* __GLIBC__ */
+#include "busybox.h"
 
 static unsigned int sync_duration = 30;
 static unsigned int flush_duration = 5;
@@ -61,13 +64,13 @@ extern int update_main(int argc, char **argv)
                                flush_duration = atoi(optarg);
                                break;
                        default:
-                               usage(update_usage);
+                               show_usage();
                }
        }
 
        pid = fork();
        if (pid < 0)
-               exit(FALSE);
+               return EXIT_FAILURE;
        else if (pid == 0) {
                /* Become a proper daemon */
                setsid();
@@ -99,12 +102,12 @@ extern int update_main(int argc, char **argv)
                                        syslog(LOG_INFO,
                                                   "This kernel does not need update(8). Exiting.");
                                        closelog();
-                                       exit(TRUE);
+                                       return EXIT_SUCCESS;
                                }
                        }
                }
        }
-       return( TRUE);
+       return EXIT_SUCCESS;
 }
 
 /*