diff options
author | Rob Landley <rob@landley.net> | 2007-11-15 20:43:35 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-11-15 20:43:35 -0600 |
commit | 00ee268e3a4c677bb46c0c0b8f97038a7f2699d8 (patch) | |
tree | e0f3d3bbab9b7a636f14f5f6cd3fd81c6e09913d | |
parent | 627dc77bb6749dbb2cb41d2bbca0c8e41c7504ca (diff) | |
download | toybox-00ee268e3a4c677bb46c0c0b8f97038a7f2699d8.tar.gz |
Simplify touch -l slightly.
-rw-r--r-- | toys/touch.c | 10 |
1 files 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: |