A small cleanup by Vladimir
[oweals/busybox.git] / touch.c
diff --git a/touch.c b/touch.c
index 5537fb63bfec60f2107d13498ea4e771358cf552..a3256d55970dc4fc746a2b1d29e22ac0d3ba620e 100644 (file)
--- a/touch.c
+++ b/touch.c
@@ -3,7 +3,7 @@
  * Mini touch implementation for busybox
  *
  *
- * Copyright (C) 1999,2000 by Lineo, inc.
+ * Copyright (C) 1999,2000,2001 by Lineo, inc.
  * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -28,6 +28,8 @@
 #include <fcntl.h>
 #include <utime.h>
 #include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
 
 extern int touch_main(int argc, char **argv)
 {
@@ -42,13 +44,13 @@ extern int touch_main(int argc, char **argv)
                                create = FALSE;
                                break;
                        default:
-                               usage(touch_usage);
+                               show_usage();
                        }
                }
        }
 
        if (argc < 1) {
-               usage(touch_usage);
+               show_usage();
        }
 
        while (argc > 0) {
@@ -58,12 +60,12 @@ extern int touch_main(int argc, char **argv)
                        if (create == FALSE && errno == ENOENT)
                                return EXIT_SUCCESS;
                        else {
-                               fatalError("%s", strerror(errno));
+                               perror_msg_and_die("%s", *argv);
                        }
                }
                close(fd);
                if (utime(*argv, NULL)) {
-                       fatalError("%s", strerror(errno));
+                       perror_msg_and_die("%s", *argv);
                }
                argc--;
                argv++;