style: spaces -> tabs
This commit is contained in:
parent
968842909e
commit
bf9cbfbf2b
1 changed files with 19 additions and 19 deletions
38
someblocks.c
38
someblocks.c
|
@ -130,21 +130,21 @@ void psomebar()
|
||||||
{
|
{
|
||||||
if (!getstatus(statusstr[0], statusstr[1]))//Only write out if text has changed.
|
if (!getstatus(statusstr[0], statusstr[1]))//Only write out if text has changed.
|
||||||
return;
|
return;
|
||||||
if (somebarFd < 0) {
|
if (somebarFd < 0) {
|
||||||
somebarFd = open(somebarPath, O_WRONLY|O_CLOEXEC);
|
somebarFd = open(somebarPath, O_WRONLY|O_CLOEXEC);
|
||||||
if (somebarFd < 0 && errno == ENOENT) {
|
if (somebarFd < 0 && errno == ENOENT) {
|
||||||
// assume somebar is not ready yet
|
// assume somebar is not ready yet
|
||||||
sleep(1);
|
sleep(1);
|
||||||
somebarFd = open(somebarPath, O_WRONLY|O_CLOEXEC);
|
somebarFd = open(somebarPath, O_WRONLY|O_CLOEXEC);
|
||||||
}
|
}
|
||||||
if (somebarFd < 0) {
|
if (somebarFd < 0) {
|
||||||
perror("open");
|
perror("open");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
write(somebarFd, "status ", 7);
|
write(somebarFd, "status ", 7);
|
||||||
write(somebarFd, statusstr[0], strlen(statusstr[0]));
|
write(somebarFd, statusstr[0], strlen(statusstr[0]));
|
||||||
write(somebarFd, "\n", 1);
|
write(somebarFd, "\n", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -183,8 +183,8 @@ void termhandler()
|
||||||
|
|
||||||
void sigpipehandler()
|
void sigpipehandler()
|
||||||
{
|
{
|
||||||
close(somebarFd);
|
close(somebarFd);
|
||||||
somebarFd = -1;
|
somebarFd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
|
@ -195,8 +195,8 @@ int main(int argc, char** argv)
|
||||||
else if (!strcmp("-p",argv[i]))
|
else if (!strcmp("-p",argv[i]))
|
||||||
writestatus = pstdout;
|
writestatus = pstdout;
|
||||||
}
|
}
|
||||||
strcpy(somebarPath, getenv("XDG_RUNTIME_DIR"));
|
strcpy(somebarPath, getenv("XDG_RUNTIME_DIR"));
|
||||||
strcat(somebarPath, "/somebar-0");
|
strcat(somebarPath, "/somebar-0");
|
||||||
delimLen = MIN(delimLen, strlen(delim));
|
delimLen = MIN(delimLen, strlen(delim));
|
||||||
delim[delimLen++] = '\0';
|
delim[delimLen++] = '\0';
|
||||||
signal(SIGTERM, termhandler);
|
signal(SIGTERM, termhandler);
|
||||||
|
|
Reference in a new issue