Mercurial > hg > toybox
comparison toys/other/truncate.c @ 780:6cc69be43c42
Have error_msg() and friends set TT.exitval to 1 if it's still 0, clean out other places that were setting it that no longer need to.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 02 Jan 2013 02:00:35 -0600 |
parents | 786841fdb1e0 |
children | e5b52720f539 |
comparison
equal
deleted
inserted
replaced
779:90e98cdb1b7c | 780:6cc69be43c42 |
---|---|
24 ) | 24 ) |
25 | 25 |
26 static void do_truncate(int fd, char *name) | 26 static void do_truncate(int fd, char *name) |
27 { | 27 { |
28 if (fd<0) return; | 28 if (fd<0) return; |
29 if (ftruncate(fd, TT.size)) { | 29 if (ftruncate(fd, TT.size)) perror_msg("'%s' to '%ld'", name, TT.size); |
30 perror_msg("failed to set '%s' to '%ld'", name, TT.size); | |
31 toys.exitval = EXIT_FAILURE; | |
32 } | |
33 } | 30 } |
34 | 31 |
35 void truncate_main(void) | 32 void truncate_main(void) |
36 { | 33 { |
37 int cr = !(toys.optflags&1); | 34 int cr = !(toys.optflags&1); |