From 00ee268e3a4c677bb46c0c0b8f97038a7f2699d8 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 15 Nov 2007 20:43:35 -0600 Subject: Simplify touch -l slightly. --- toys/touch.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/toys/touch.c b/toys/touch.c index 514ee1be..a06204ac 100644 --- a/toys/touch.c +++ b/toys/touch.c @@ -25,17 +25,11 @@ int touch_main(void) char *arg; int i, set_a, set_m, create; time_t curr_a, curr_m; - off_t length; set_a = !!(toys.optflags & ATIME); set_m = !!(toys.optflags & MTIME); create = !(toys.optflags & NO_CREATE); - if (toys.optflags & LENGTH) - length = toy.touch.length; - else - length = -1; - if (toys.optflags & REFERENCE) { struct stat sb; if (toys.optflags & TIME) @@ -86,8 +80,8 @@ time_error: buf.actime = sb.st_atime; } - if (length != -1) - if (truncate(arg, length)) + if (toys.optflags & LENGTH) + if (truncate(arg, toy.touch.length)) goto error; if (utime(arg, &buf)) error: -- cgit v1.2.3