remove unneeded `path` variable

This commit is contained in:
Raphael Robatsch 2022-03-05 10:11:35 +01:00
parent f7f684828d
commit ad7dea8232
1 changed files with 3 additions and 6 deletions

View File

@ -455,15 +455,12 @@ int main(int argc, char* argv[])
if (optind >= argc) { if (optind >= argc) {
die("Expected command"); die("Expected command");
} }
std::string path;
if (statusFifoName.empty()) { if (statusFifoName.empty()) {
path = std::string {getenv("XDG_RUNTIME_DIR")} + "/somebar-0"; statusFifoName = std::string {getenv("XDG_RUNTIME_DIR")} + "/somebar-0";
} else {
path = statusFifoName;
} }
statusFifoWriter = open(path.c_str(), O_WRONLY | O_CLOEXEC); statusFifoWriter = open(statusFifoName.c_str(), O_WRONLY | O_CLOEXEC);
if (statusFifoWriter < 0) { if (statusFifoWriter < 0) {
fprintf(stderr, "could not open %s: ", path.c_str()); fprintf(stderr, "could not open %s: ", statusFifoName.c_str());
perror(""); perror("");
exit(1); exit(1);
} }