* 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 flags;
int status = EXIT_SUCCESS;
-
- flags = bb_getopt_ulflags(argc, argv, "c");
+ int flags = getopt32(argc, argv, "c");
argv += optind;
do {
if (utime(*argv, NULL)) {
- if (errno == ENOENT) { /* no such file*/
- if (flags & 1) { /* Creation is disabled, so ignore. */
+ if (errno == ENOENT) { /* no such file */
+ if (flags) { /* Creation is disabled, so ignore. */
continue;
}
/* Try to create the file. */