From d73c8b930b6c164a58621ae09a6cc727976e5657 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 6 Feb 2015 19:51:20 +0100 Subject: Include cleanup Also remove all uses of unistd.h by replacing unlink with std::rename --- src/MinedMap.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/MinedMap.cpp') diff --git a/src/MinedMap.cpp b/src/MinedMap.cpp index 8624636..0193bbc 100644 --- a/src/MinedMap.cpp +++ b/src/MinedMap.cpp @@ -45,7 +45,6 @@ #include #include #include -#include namespace MinedMap { @@ -100,11 +99,11 @@ static void writeImage(const std::string &output, const uint8_t *data, bool colo if (std::rename(tmpfile.c_str(), output.c_str()) < 0) { std::fprintf(stderr, "Unable to save %s: %s\n", output.c_str(), std::strerror(errno)); - unlink(tmpfile.c_str()); + std::remove(tmpfile.c_str()); } } catch (const std::exception& ex) { - unlink(tmpfile.c_str()); + std::remove(tmpfile.c_str()); throw; } } @@ -223,11 +222,11 @@ static bool makeMipmap(const std::string &dir, size_t level, size_t x, size_t z, if (std::rename(tmpfile.c_str(), output.c_str()) < 0) { std::fprintf(stderr, "Unable to save %s: %s\n", output.c_str(), std::strerror(errno)); - unlink(tmpfile.c_str()); + std::remove(tmpfile.c_str()); } } catch (const std::exception& ex) { - unlink(tmpfile.c_str()); + std::remove(tmpfile.c_str()); throw; } -- cgit v1.2.3