mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-10 22:04:28 +00:00
remove exit polling
This commit is contained in:
parent
ee2918b376
commit
d4a9c293f5
2 changed files with 2 additions and 30 deletions
|
@ -75,7 +75,7 @@ void bar_item_script_update(struct bar_item* bar_item, bool forced) {
|
|||
if (strlen(bar_item->script) > 0) {
|
||||
bar_item->counter++;
|
||||
if (bar_item->update_frequency <= bar_item->counter || forced) {
|
||||
bar_item->counter = 0;
|
||||
bar_item->counter = 0;
|
||||
fork_exec(bar_item->script, &bar_item->signal_args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,36 +73,8 @@ static int client_send_message(int argc, char **argv) {
|
|||
}
|
||||
|
||||
shutdown(sockfd, SHUT_WR);
|
||||
|
||||
int result = EXIT_SUCCESS;
|
||||
int byte_count = 0;
|
||||
char rsp[BUFSIZ];
|
||||
|
||||
struct pollfd fds[] = {
|
||||
{ sockfd, POLLIN, 0 }
|
||||
};
|
||||
|
||||
while (poll(fds, 1, -1) > 0) {
|
||||
if (fds[0].revents & POLLIN) {
|
||||
if ((byte_count = recv(sockfd, rsp, sizeof(rsp)-1, 0)) <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
rsp[byte_count] = '\0';
|
||||
|
||||
if (rsp[0] == FAILURE_MESSAGE[0]) {
|
||||
result = EXIT_FAILURE;
|
||||
fprintf(stderr, "%s", rsp + 1);
|
||||
fflush(stderr);
|
||||
} else {
|
||||
fprintf(stdout, "%s", rsp);
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
socket_close(sockfd);
|
||||
return result;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
static void acquire_lockfile(void) {
|
||||
|
|
Loading…
Reference in a new issue