aboutsummaryrefslogtreecommitdiff
path: root/slave.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-31 15:10:39 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-31 15:10:39 +0000
commitb661513245e5bc07358237a39e4d100d124f64fc (patch)
treeec60e656623aadaddd6fb1091afbb1000cc5147e /slave.c
parentconfig: pipe-*: fix length calculation of the pipe command substring (diff)
slave: user-notifications: emit errors first, then warnings and last deprecations
Diffstat (limited to 'slave.c')
-rw-r--r--slave.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/slave.c b/slave.c
index c28613c0..8019f20c 100644
--- a/slave.c
+++ b/slave.c
@@ -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;