diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2021-12-21 12:12:54 +0100 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2021-12-21 12:12:54 +0100 |
| commit | 81faee46ddf6c46bde515ec353e7e91b4b12b815 (patch) | |
| tree | 9d26ec4e58d9c6fe38ceaac08e05b9dc6d0310f2 | |
| parent | 998d80a3a18a44802340bf398c9efa92ce871bac (diff) | |
swaybar: fix errno handling in status_handle_readable
If getline fails once, it was not reset before the next getline
call. errno is only overwritten by getline on error.
(cherry picked from commit 414950bbc8e833362a689cc11720855e8edd1323)
| -rw-r--r-- | swaybar/status_line.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/swaybar/status_line.c b/swaybar/status_line.c index a97f3525..2e9bb7f1 100644 --- a/swaybar/status_line.c +++ b/swaybar/status_line.c @@ -117,11 +117,11 @@ bool status_handle_readable(struct status_line *status) { status->text = status->buffer; // intentional fall-through case PROTOCOL_TEXT: - errno = 0; while (true) { if (status->buffer[read_bytes - 1] == '\n') { status->buffer[read_bytes - 1] = '\0'; } + errno = 0; read_bytes = getline(&status->buffer, &status->buffer_size, status->read); if (errno == EAGAIN) { |
