diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2024-07-23 07:42:14 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-07-23 07:42:14 +0000 |
| commit | c7cffea9ee65dc38a1e87d1254c4097990d7e96b (patch) | |
| tree | 0838c7078ce9e007127987fd1ef171b50c80b2bc | |
| parent | notify: XDG token is now expected to be prefixed with xdgtoken= (diff) | |
notify: stdout is a bad name
| -rw-r--r-- | notify.c | 16 | ||||
| -rw-r--r-- | notify.h | 2 |
2 files changed, 9 insertions, 9 deletions
@@ -28,13 +28,13 @@ notify_free(struct terminal *term, struct notification *notif) free(notif->body); free(notif->icon); free(notif->xdg_token); - free(notif->stdout); + free(notif->stdout_data); } static void consume_stdout(struct notification *notif, bool eof) { - char *data = notif->stdout; + char *data = notif->stdout_data; const char *line = data; size_t left = notif->stdout_sz; @@ -60,7 +60,7 @@ consume_stdout(struct notification *notif, bool eof) left -= len + (eol != NULL ? 1 : 0); } - memmove(notif->stdout, data, left); + memmove(notif->stdout_data, data, left); notif->stdout_sz = left; } @@ -92,12 +92,12 @@ fdm_notify_stdout(struct fdm *fdm, int fd, int events, void *data) } if (count > 0 && notif != NULL) { - if (notif->stdout == NULL) { + if (notif->stdout_data == NULL) { xassert(notif->stdout_sz == 0); - notif->stdout = xmemdup(buf, count); + notif->stdout_data = xmemdup(buf, count); } else { - notif->stdout = xrealloc(notif->stdout, notif->stdout_sz + count); - memcpy(¬if->stdout[notif->stdout_sz], buf, count); + notif->stdout_data = xrealloc(notif->stdout_data, notif->stdout_sz + count); + memcpy(¬if->stdout_data[notif->stdout_sz], buf, count); } notif->stdout_sz += count; @@ -156,7 +156,7 @@ notify_notify(const struct terminal *term, struct notification *notif) xassert(notif->xdg_token == NULL); xassert(notif->pid == 0); xassert(notif->stdout_fd == 0); - xassert(notif->stdout == NULL); + xassert(notif->stdout_data == NULL); notif->pid = -1; notif->stdout_fd = -1; @@ -45,7 +45,7 @@ struct notification { pid_t pid; /* Notifier command PID */ int stdout_fd; /* Notifier command's stdout */ - char *stdout; /* Data we've reado from command's stdout */ + char *stdout_data; /* Data we've reado from command's stdout */ size_t stdout_sz; }; |
