remove unneeded path variable

This commit is contained in:
Raphael Robatsch 2022-03-05 10:11:35 +01:00
parent f7f684828d
commit ad7dea8232

View file

@ -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);
}