Modified so that it "works" for archs other than i386... arm in particular.
[oweals/busybox.git] / coreutils / sync.c
index b9f52c8b08793907f3a914450242223bcec1a5bd..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 ( **(argv+1) == '-' ) {
-       usage( "sync\nWrite all buffered filesystem blocks to disk.\n");
-    }
-    return sync();
+       if (argc > 1 && **(argv + 1) == '-')
+               show_usage();
+       sync();
+       return(EXIT_SUCCESS);
 }
-