It's not an error if unlink(2) fails because the pathname doesn't exist.
Noticed by: kevlo Pointy hat to: wollman
This commit is contained in:
parent
b1e43d7145
commit
046e176269
@ -723,7 +723,7 @@ install_zoneinfo_file(const char *zoneinfo_file)
|
||||
return (DITEM_FAILURE | DITEM_RECREATE);
|
||||
}
|
||||
|
||||
if (unlink(path_localtime) < 0) {
|
||||
if (unlink(path_localtime) < 0 && errno != ENOENT) {
|
||||
snprintf(prompt, sizeof(prompt),
|
||||
"Could not unlink %s: %s",
|
||||
path_localtime, strerror(errno));
|
||||
@ -780,7 +780,7 @@ install_zoneinfo_file(const char *zoneinfo_file)
|
||||
fprintf(stderr, "%s\n", prompt);
|
||||
return (DITEM_FAILURE | DITEM_RECREATE);
|
||||
}
|
||||
if (unlink(path_localtime) < 0) {
|
||||
if (unlink(path_localtime) < 0 && errno != ENOENT) {
|
||||
snprintf(prompt, sizeof(prompt),
|
||||
"Could not unlink %s: %s",
|
||||
path_localtime, strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user