From 977efd15e5b085c3d1b65b3d1b5d3360149157cd Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 14 Jan 2017 06:02:43 +0100 Subject: [PATCH] fix(ci): Compiler errors --- src/ipc.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ipc.cpp b/src/ipc.cpp index 6b13b217..1add12f5 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -1,12 +1,14 @@ #include #include #include +#include #include #include "common.hpp" #include "utils/file.hpp" using namespace polybar; +using namespace std; #ifndef IPC_CHANNEL_PREFIX #define IPC_CHANNEL_PREFIX "/tmp/polybar_mqueue." @@ -59,7 +61,7 @@ int main(int argc, char** argv) { log(E_INVALID_CHANNEL, "No channel available for pid " + args[1]); } - pid = std::atoi(args[1].c_str()); + pid = atoi(args[1].c_str()); args.erase(args.begin()); args.erase(args.begin()); } @@ -103,12 +105,12 @@ int main(int argc, char** argv) { int handle_pid{0}; if ((p = handle.rfind('.')) != string::npos) { - handle_pid = std::atoi(handle.substr(p + 1).c_str()); + handle_pid = atoi(handle.substr(p + 1).c_str()); } if (!file_util::exists("/proc/" + to_string(handle_pid))) { if (unlink(handle.c_str()) == -1) { - log(E_GENERIC, "Could not remove stale ipc channel: "s + std::strerror(errno)); + log(E_GENERIC, "Could not remove stale ipc channel: "s + strerror(errno)); } else { log("Removed stale ipc channel: " + handle); } @@ -118,7 +120,7 @@ int main(int argc, char** argv) { if (write(fd, payload.c_str(), payload.size()) != -1) { log("Successfully wrote \"" + payload + "\" to \"" + handle + "\""); } else { - log(E_WRITE, "Failed to write \"" + payload + "\" to \"" + handle + "\" (err: " + std::strerror(errno) + ")"); + log(E_WRITE, "Failed to write \"" + payload + "\" to \"" + handle + "\" (err: " + strerror(errno) + ")"); } } }