diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-07-31 15:10:39 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-07-31 15:10:39 +0000 |
| commit | b661513245e5bc07358237a39e4d100d124f64fc (patch) | |
| tree | ec60e656623aadaddd6fb1091afbb1000cc5147e | |
| parent | config: pipe-*: fix length calculation of the pipe command substring (diff) | |
slave: user-notifications: emit errors first, then warnings and last deprecations
| -rw-r--r-- | slave.c | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -102,9 +102,28 @@ emit_one_notification(int fd, const struct user_notification *notif) static bool emit_notifications(int fd, const user_notifications_t *notifications) { + /* Errors first */ tll_foreach(*notifications, it) { - if (!emit_one_notification(fd, &it->item)) - return false; + if (it->item.kind == USER_NOTIFICATION_ERROR) { + if (!emit_one_notification(fd, &it->item)) + return false; + } + } + + /* Then warnings */ + tll_foreach(*notifications, it) { + if (it->item.kind == USER_NOTIFICATION_WARNING) { + if (!emit_one_notification(fd, &it->item)) + return false; + } + } + + /* Finally deprecation messages */ + tll_foreach(*notifications, it) { + if (it->item.kind == USER_NOTIFICATION_DEPRECATED) { + if (!emit_one_notification(fd, &it->item)) + return false; + } } return true; |
