aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/touch.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-08-25 15:32:22 -0500
committerRob Landley <rob@landley.net>2018-08-25 15:32:22 -0500
commit482c422f8e8ec517de071266d425b425c4628103 (patch)
tree709d459ba58b1416c340ffedab69faf21d4bee99 /toys/posix/touch.c
parent79c403179b603a9f3c8cd120a93c2f560017864b (diff)
downloadtoybox-482c422f8e8ec517de071266d425b425c4628103.tar.gz
Convert more argument variables in GLOBALS() to new style.
Diffstat (limited to 'toys/posix/touch.c')
-rw-r--r--toys/posix/touch.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/toys/posix/touch.c b/toys/posix/touch.c
index 214d6cf9..5e5588b1 100644
--- a/toys/posix/touch.c
+++ b/toys/posix/touch.c
@@ -27,9 +27,7 @@ config TOUCH
#include "toys.h"
GLOBALS(
- char *time;
- char *file;
- char *date;
+ char *t, *r, *d;
)
void touch_main(void)
@@ -52,10 +50,10 @@ void touch_main(void)
// List of search types
if (toys.optflags & FLAG_d) {
format = (char *[]){"%Y-%m-%dT%T", "%Y-%m-%d %T", 0};
- date = TT.date;
+ date = TT.d;
} else {
format = (char *[]){"%m%d%H%M", "%y%m%d%H%M", "%C%y%m%d%H%M", 0};
- date = TT.time;
+ date = TT.t;
}
// Trailing Z means UTC timezone, don't expect libc to know this.
@@ -101,10 +99,10 @@ void touch_main(void)
// Set time from -r?
- if (TT.file) {
+ if (TT.r) {
struct stat st;
- xstat(TT.file, &st);
+ xstat(TT.r, &st);
ts[0] = st.st_atim;
ts[1] = st.st_mtim;
}