aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;