Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libnotify
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GNOME
libnotify
Commits
f30b43f1
Commit
f30b43f1
authored
3 years ago
by
Marco Trevisan
Browse files
Options
Downloads
Patches
Plain Diff
debian/patches: Exit with an error if showing notification fails
LP: #1970647
parent
7e8e7ecc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/notify-send-Give-failing-exit-code-if-showing-notificatio.patch
+56
-0
56 additions, 0 deletions
...-send-Give-failing-exit-code-if-showing-notificatio.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
57 additions
and
0 deletions
debian/patches/notify-send-Give-failing-exit-code-if-showing-notificatio.patch
0 → 100644
+
56
−
0
View file @
f30b43f1
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 12 May 2020 10:12:26 -0400
Subject: notify-send: Give failing exit code if showing notification fails
Right now notify-send will quietly return a successful exit status
even if showing the notification fails.
This commit changes the behavior to instead fail on failure.
https://gitlab.gnome.org/GNOME/libnotify/-/merge_requests/13
Origin: https://gitlab.gnome.org/GNOME/libnotify/-/commit/a228f1e
Bug-Ubuntu: https://pad.lv/1970647
---
tools/notify-send.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tools/notify-send.c b/tools/notify-send.c
index 67e0b03..52fa46a 100644
--- a/tools/notify-send.c
+++ b/tools/notify-send.c
@@ -132,7 +132,7 @@
main (int argc, char *argv[])
static char **n_text = NULL;
static char **hints = NULL;
static gboolean do_version = FALSE;
- static gboolean hint_error = FALSE;
+ static gboolean hint_error = FALSE, show_error = FALSE;
static glong expire_timeout = NOTIFY_EXPIRES_DEFAULT;
GOptionContext *opt_ctx;
NotifyNotification *notify;
@@ -274,12 +274,22 @@
main (int argc, char *argv[])
}
}
- if (!hint_error)
- notify_notification_show (notify, NULL);
+ if (!hint_error) {
+ retval = notify_notification_show (notify, &error);
+
+ if (!retval) {
+ fprintf (stderr, "%s\n", error->message);
+ g_error_free (error);
+ show_error = TRUE;
+ }
+ }
g_object_unref (G_OBJECT (notify));
notify_uninit ();
- exit (hint_error);
+ if (hint_error || show_error)
+ exit (1);
+
+ return 0;
}
This diff is collapsed.
Click to expand it.
debian/patches/series
0 → 100644
+
1
−
0
View file @
f30b43f1
notify-send-Give-failing-exit-code-if-showing-notificatio.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment