mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-30 14:42:01 -08:00
touch_file, remove_file: ignore non-existent files
This commit is contained in:
@@ -280,14 +280,14 @@ int exit_status (int wait_status)
|
||||
|
||||
void touch_file (const std::string& filename)
|
||||
{
|
||||
if (utimes(filename.c_str(), NULL) == -1) {
|
||||
if (utimes(filename.c_str(), NULL) == -1 && errno != ENOENT) {
|
||||
throw System_error("utimes", filename, errno);
|
||||
}
|
||||
}
|
||||
|
||||
void remove_file (const std::string& filename)
|
||||
{
|
||||
if (unlink(filename.c_str()) == -1) {
|
||||
if (unlink(filename.c_str()) == -1 && errno != ENOENT) {
|
||||
throw System_error("unlink", filename, errno);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user