* archival/bunzip2.c (bunzip2_main): Do not remove files if writing to standard
[oweals/busybox.git] / coreutils / sync.c
index 145ed1eda8d25f0a8fa901f664dbaa69f77352b6..d5816806569ee2d6b2968d1fc19896955ad0f9d5 100644 (file)
@@ -1,7 +1,7 @@
+/* vi: set sw=4 ts=4: */
 /*
  * Mini sync implementation for busybox
  *
- *
  * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
  *
  * This program is free software; you can redistribute it and/or modify
  *
  */
 
-#include "internal.h"
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "busybox.h"
 
-extern int
-sync_main(int argc, char * * argv)
+extern int sync_main(int argc, char **argv)
 {
-    if ( argc>1 && **(argv+1) == '-' ) {
-       usage( "sync\n\nWrite all buffered filesystem blocks to disk.\n");
-    }
-    exit( sync());
+       if (argc > 1 && **(argv + 1) == '-')
+               show_usage();
+       sync();
+       return(EXIT_SUCCESS);
 }
-