Exit with failure status if we are unable to list any files or
[oweals/busybox.git] / coreutils / touch.c
index 1364bb7d57c1f5655a89ca1664faddcac9a89ce0..7db6c6e3383ab2156d6c1569174a44b5cc28d3e3 100644 (file)
  *
  */
 
-#include "internal.h"
+#include "busybox.h"
 #include <stdio.h>
 #include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <utime.h>
 #include <errno.h>
 
-
-static const char touch_usage[] = "touch [-c] file [file ...]\n"
-#ifndef BB_FEATURE_TRIVIAL_HELP
-       "\nUpdate the last-modified date on the given file[s].\n\n"
-       "Options:\n"
-       "\t-c\tDo not create any files\n"
-#endif
-       ;
-
-
 extern int touch_main(int argc, char **argv)
 {
        int fd;
@@ -70,16 +59,16 @@ extern int touch_main(int argc, char **argv)
                        if (create == FALSE && errno == ENOENT)
                                exit(TRUE);
                        else {
-                               fatalError("touch: %s", strerror(errno));
+                               fatalError("%s", strerror(errno));
                        }
                }
                close(fd);
                if (utime(*argv, NULL)) {
-                       fatalError("touch: %s", strerror(errno));
+                       fatalError("%s", strerror(errno));
                }
                argc--;
                argv++;
        }
 
-       exit(TRUE);
+       return(TRUE);
 }