summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-08-06 00:50:34 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-07-12 15:13:33 +0300
commit3b49ec3a0b4bab40ddb9a2a9789e787089870c93 (patch)
tree8c1d09f488de256d2a562ef1fcbba30b3d792e46
parentd8cad639c66876357a8b0790c5ad68e091963b3e (diff)
downloadqtlocation-mapboxgl-3b49ec3a0b4bab40ddb9a2a9789e787089870c93.tar.gz
[core] Prefer std:: functions over POSIX
s/unlink/std::remove
-rw-r--r--src/mbgl/util/io.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mbgl/util/io.cpp b/src/mbgl/util/io.cpp
index 9adc3b8988..6a6ed7b250 100644
--- a/src/mbgl/util/io.cpp
+++ b/src/mbgl/util/io.cpp
@@ -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");
}
}