- add libbb function str_tolower to convert a string to lowercase.
[oweals/busybox.git] / coreutils / touch.c
index 72bf904f8fa2926eccc2b624159b5ade14456169..5f81b2380858dd9086e3c43b06be775c71ace2b0 100644 (file)
  * Also, exiting on a failure was a bug.  All args should be processed.
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <utime.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
 #include "busybox.h"
 
+/* This is a NOFORK applet. Be very careful! */
+
+int touch_main(int argc, char **argv);
 int touch_main(int argc, char **argv)
 {
        int fd;
        int status = EXIT_SUCCESS;
-       bool flags = (getopt32(argc, argv, "c") & 1);
+       int flags = getopt32(argc, argv, "c");
 
        argv += optind;
 
@@ -40,7 +36,7 @@ int touch_main(int argc, char **argv)
 
        do {
                if (utime(*argv, NULL)) {
-                       if (errno == ENOENT) {  /* no such file*/
+                       if (errno == ENOENT) {  /* no such file */
                                if (flags) {    /* Creation is disabled, so ignore. */
                                        continue;
                                }