Pádraig Brady
200501052e
truncate: improve handling of non regular files
...
Previously we copied `dd` and suppressed error messages
when truncating neither regular files or shared mem objects.
This was valid for `dd`, as truncation is ancillary to copying
it may also do, but for `truncate` we should display all errors.
Also we used the st_size from non regular files which is undefined,
so we display an error when the user tries this.
* src/truncate (do_truncate): Error when referencing the size
of non regular files or non shared memory objects. Display all
errors returned by ftruncate().
(main): Error when referencing the size of non regular files or
non shared memory objects. Don't suppress error messages for
any file types that can't be opened for writing.
* tests/misc/truncate-dir-fail: Check that referencing the
size of a directory is not supported.
* tests/misc/truncate-fifo: Ensure the test doesn't hang
by using the `timeout` command. Don't test the return from
running ftruncate on the fifo as it's system dependent as
to whether this fails or not.
NEWS: Mention the change in behavior.
Reported by Jim Meyering.
2010-05-29 10:45:13 +01:00
..
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:48 +01:00
2010-01-01 14:06:48 +01:00
2010-01-01 14:06:47 +01:00
2010-03-26 14:31:16 +00:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-02-25 08:54:49 -07:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-26 11:33:53 +02:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-02-01 15:36:56 +00:00
2010-02-01 08:26:12 +01:00
2010-03-29 08:28:51 +02:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-23 18:10:41 +02:00
2010-01-01 14:06:47 +01:00
2010-03-26 14:31:16 +00:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:48 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-04-20 22:37:18 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-18 23:44:34 +01:00
2010-05-24 12:12:24 +01:00
2010-01-01 14:06:47 +01:00
2010-04-29 18:55:57 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-25 12:32:03 +02:00
2010-01-01 14:06:47 +01:00
2010-01-13 10:21:02 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-03-16 23:10:15 +00:00
2010-03-26 14:27:54 +00:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-29 10:45:13 +01:00
2010-01-01 14:06:47 +01:00
2010-05-29 10:45:13 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-28 14:23:04 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-03-29 08:28:51 +02:00
2010-01-01 14:06:47 +01:00