Remove `== TRUE' tests and convert `!= TRUE' and `== FALSE' tests to use !.
[oweals/busybox.git] / coreutils / touch.c
index 267349596bcab7badaed658ec48616e63fc9e053..f1c6dc4849fd8780a45e3cd70111bea2a6b41444 100644 (file)
@@ -53,12 +53,14 @@ extern int touch_main(int argc, char **argv)
        }
 
        while (argc > 0) {
-               fd = open(*argv, (create == FALSE) ? O_RDWR : O_RDWR | O_CREAT,
+               fd = open(*argv, create ? O_RDWR | O_CREAT : O_RDWR,
                                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
                if (fd < 0) {
-                       if (create == FALSE && errno == ENOENT)
-                               return EXIT_SUCCESS;
-                       else {
+                       if (! create && errno == ENOENT) {
+                               argc--;
+                               argv++;
+                               continue;
+                       } else {
                                perror_msg_and_die("%s", *argv);
                        }
                }