2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 13:58:05 +00:00

Warn on ftruncate failure().

This commit is contained in:
Todd C. Miller 2014-01-30 16:24:48 -07:00
parent 63e7aa9942
commit 596fc68aca

View File

@ -156,8 +156,12 @@ found_it:
debug_return_bool(true);
/* Truncate on partial write to be safe. */
if (nwritten > 0 && old_eof != (off_t)-1)
ftruncate(fd, old_eof);
if (nwritten > 0 && old_eof != (off_t)-1) {
if (ftruncate(fd, old_eof) != 0) {
warning(N_("unable to truncate time stamp file to %lld bytes"),
old_eof);
}
}
debug_return_bool(false);
}