summaryrefslogtreecommitdiff
path: root/src/truncate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/truncate.c')
-rw-r--r--src/truncate.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/truncate.c b/src/truncate.c
index 0dff8408b..ccc0e9021 100644
--- a/src/truncate.c
+++ b/src/truncate.c
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include "system.h"
+#include "die.h"
#include "error.h"
#include "quote.h"
#include "stat-size.h"
@@ -285,7 +286,7 @@ main (int argc, char **argv)
_("Invalid number"), 0);
/* Rounding to multiple of 0 is nonsensical */
if ((rel_mode == rm_rup || rel_mode == rm_rdn) && size == 0)
- error (EXIT_FAILURE, 0, _("division by zero"));
+ die (EXIT_FAILURE, 0, _("division by zero"));
got_size = true;
break;
@@ -334,7 +335,7 @@ main (int argc, char **argv)
struct stat sb;
off_t file_size = -1;
if (stat (ref_file, &sb) != 0)
- error (EXIT_FAILURE, errno, _("cannot stat %s"), quoteaf (ref_file));
+ die (EXIT_FAILURE, errno, _("cannot stat %s"), quoteaf (ref_file));
if (usable_st_size (&sb))
file_size = sb.st_size;
else
@@ -355,8 +356,8 @@ main (int argc, char **argv)
}
}
if (file_size < 0)
- error (EXIT_FAILURE, errno, _("cannot get the size of %s"),
- quoteaf (ref_file));
+ die (EXIT_FAILURE, errno, _("cannot get the size of %s"),
+ quoteaf (ref_file));
if (!got_size)
size = file_size;
else