diff --git a/src/FS.cpp b/src/FS.cpp index 04a84b80b..72bb9c72d 100644 --- a/src/FS.cpp +++ b/src/FS.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -556,7 +557,8 @@ void File::truncate () open (); if (_fh) - (void) ftruncate (_h, 0); + if (ftruncate (_h, 0)) + throw format (STRING_FILE_TRUNCATE, errno, strerror (errno)); } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/l10n/deu-DEU.h b/src/l10n/deu-DEU.h index cbf9e5aa1..7f74bff50 100644 --- a/src/l10n/deu-DEU.h +++ b/src/l10n/deu-DEU.h @@ -796,6 +796,7 @@ // File #define STRING_FILE_PERMS "Taskwarrior hat die erforderlichen Rechte auf '{1}' nicht." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed." diff --git a/src/l10n/eng-USA.h b/src/l10n/eng-USA.h index 559ce72d5..b97777e13 100644 --- a/src/l10n/eng-USA.h +++ b/src/l10n/eng-USA.h @@ -794,6 +794,7 @@ // File #define STRING_FILE_PERMS "Taskwarrior does not have the correct permissions for '{1}'." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed." diff --git a/src/l10n/epo-RUS.h b/src/l10n/epo-RUS.h index 1ca0d4fae..30ff8b1c4 100644 --- a/src/l10n/epo-RUS.h +++ b/src/l10n/epo-RUS.h @@ -796,6 +796,7 @@ // File #define STRING_FILE_PERMS "Taskwarrior ne havas la bezonatan permeson por '{1}'." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed." diff --git a/src/l10n/esp-ESP.h b/src/l10n/esp-ESP.h index a1d855704..225993a90 100644 --- a/src/l10n/esp-ESP.h +++ b/src/l10n/esp-ESP.h @@ -804,6 +804,7 @@ // File #define STRING_FILE_PERMS "Taskwarrior no tiene los permisos adecuados para '{1}'." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "El proyecto '{1}' ha cambiado." diff --git a/src/l10n/fra-FRA.h b/src/l10n/fra-FRA.h index 84c3996a8..98a25db4a 100644 --- a/src/l10n/fra-FRA.h +++ b/src/l10n/fra-FRA.h @@ -796,6 +796,7 @@ // File #define STRING_FILE_PERMS "Taskwarrior does not have the correct permissions for '{1}'." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed." diff --git a/src/l10n/ita-ITA.h b/src/l10n/ita-ITA.h index eeb3125c1..d804d44e2 100644 --- a/src/l10n/ita-ITA.h +++ b/src/l10n/ita-ITA.h @@ -795,6 +795,7 @@ // File #define STRING_FILE_PERMS "Taskwarrior non dispone dei permessi corretti per '{1}'." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "Il progetto '{1}' è stato modificat." diff --git a/src/l10n/jpn-JPN.h b/src/l10n/jpn-JPN.h index b19f8298f..ac6b31f4c 100644 --- a/src/l10n/jpn-JPN.h +++ b/src/l10n/jpn-JPN.h @@ -796,6 +796,7 @@ // File #define STRING_FILE_PERMS "Taskwarrior does not have the correct permissions for '{1}'." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed." diff --git a/src/l10n/pol-POL.h b/src/l10n/pol-POL.h index 7d0fd121c..dec6b975e 100644 --- a/src/l10n/pol-POL.h +++ b/src/l10n/pol-POL.h @@ -796,6 +796,7 @@ // File #define STRING_FILE_PERMS "Taskwarrior nie posiada praw dostępu do '{1}'." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed." diff --git a/src/l10n/por-PRT.h b/src/l10n/por-PRT.h index 556467d6e..9d2ef8b74 100644 --- a/src/l10n/por-PRT.h +++ b/src/l10n/por-PRT.h @@ -796,6 +796,7 @@ // File #define STRING_FILE_PERMS "O taskwarrior não encontrou as permissões corretas em '{1}'." +#define STRING_FILE_TRUNCATE "Could not truncate file: {1} {2}" // helpers #define STRING_HELPER_PROJECT_CHANGE "The project '{1}' has changed."