diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-06-21 08:53:20 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-06-21 08:53:20 +0000 |
commit | fd8e262d7b2c4b797b7e579d6828ffd9c5c66b50 (patch) | |
tree | 82104f3aef8d970778d47b4c3a8178b5f88f303a /tests | |
parent | 939bd81b49e72790f3bf89000ea704960b9bb023 (diff) | |
download | paxutils-fd8e262d7b2c4b797b7e579d6828ffd9c5c66b50.tar.gz |
Print errno status on errors.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/genfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/genfile.c b/tests/genfile.c index 968dce5..bf40e6b 100644 --- a/tests/genfile.c +++ b/tests/genfile.c @@ -419,13 +419,13 @@ generate_simple_file (char *filename) { fp = fopen (filename, seek_offset ? "rb+" : "wb"); if (!fp) - error (EXIT_FAILURE, 0, _("cannot open `%s'"), filename); + error (EXIT_FAILURE, errno, _("cannot open `%s'"), filename); } else fp = stdout; if (fseeko (fp, seek_offset, 0)) - error (EXIT_FAILURE, 0, _("cannot seek: %s"), strerror (errno)); + error (EXIT_FAILURE, errno, "%s", _("cannot seek")); fill (fp, file_length, pattern); @@ -512,7 +512,7 @@ generate_sparse_file (int argc, char **argv) flags |= O_TRUNC; fd = open (file_name, flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (fd < 0) - error (EXIT_FAILURE, 0, _("cannot open `%s'"), file_name); + error (EXIT_FAILURE, errno, _("cannot open `%s'"), file_name); buffer = xmalloc (block_size); |