[core] Prefer std:: functions over POSIX
s/unlink/std::remove
This commit is contained in:
committed by
Thiago Marcos P. Santos
parent
d8cad639c6
commit
3b49ec3a0b
@@ -6,8 +6,6 @@
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
@@ -43,8 +41,8 @@ optional<std::string> readFile(const std::string &filename) {
|
||||
}
|
||||
|
||||
void deleteFile(const std::string& filename) {
|
||||
const int ret = unlink(filename.c_str());
|
||||
if (ret == -1) {
|
||||
const int ret = std::remove(filename.c_str());
|
||||
if (ret != 0) {
|
||||
throw IOException(errno, "failed to unlink file");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user