From ad7dea82328cf25dc86600f552d472c89c7eaa5a Mon Sep 17 00:00:00 2001 From: Raphael Robatsch Date: Sat, 5 Mar 2022 10:11:35 +0100 Subject: [PATCH] remove unneeded `path` variable --- src/main.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e3795e0..e1bde19 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -455,15 +455,12 @@ int main(int argc, char* argv[]) if (optind >= argc) { die("Expected command"); } - std::string path; if (statusFifoName.empty()) { - path = std::string {getenv("XDG_RUNTIME_DIR")} + "/somebar-0"; - } else { - path = statusFifoName; + statusFifoName = std::string {getenv("XDG_RUNTIME_DIR")} + "/somebar-0"; } - statusFifoWriter = open(path.c_str(), O_WRONLY | O_CLOEXEC); + statusFifoWriter = open(statusFifoName.c_str(), O_WRONLY | O_CLOEXEC); if (statusFifoWriter < 0) { - fprintf(stderr, "could not open %s: ", path.c_str()); + fprintf(stderr, "could not open %s: ", statusFifoName.c_str()); perror(""); exit(1); }