Chromium Code Reviews| Index: runtime/bin/file_linux.cc |
| diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc |
| index ceac63052bb2967dc5d10b1c465c74e7f7738ec1..99973cb79ed4381b7c90825645152cf29227018d 100644 |
| --- a/runtime/bin/file_linux.cc |
| +++ b/runtime/bin/file_linux.cc |
| @@ -167,11 +167,21 @@ bool File::CreateLink(const char* name, const char* target) { |
| bool File::Delete(const char* name) { |
| - int status = TEMP_FAILURE_RETRY(remove(name)); |
| - if (status == -1) { |
| + if (File::GetType(name, false) == File::kIsLink) { |
| + if (File::GetType(name, true) == File::kIsFile) { |
| + return TEMP_FAILURE_RETRY(unlink(name)) == 0; |
| + } |
|
Søren Gjesse
2013/04/05 12:52:50
Set errno before returning false.
Anders Johnsen
2013/04/08 06:50:49
Done.
|
| return false; |
| } |
| - return true; |
| + return TEMP_FAILURE_RETRY(unlink(name)) == 0; |
| +} |
| + |
| + |
| +bool File::DeleteLink(const char* name) { |
| + if (File::GetType(name, false) == kIsLink) { |
| + return TEMP_FAILURE_RETRY(unlink(name)) == 0; |
| + } |
| + return false; |
|
Søren Gjesse
2013/04/05 12:52:50
Set errno before returning false.
Anders Johnsen
2013/04/08 06:50:49
Done.
|
| } |