!26 [sync] PR-25: fix ukui-notification-daemon SIGSEGV

From: @openeuler-sync-bot 
Reviewed-by: @peijiankang 
Signed-off-by: @peijiankang
This commit is contained in:
openeuler-ci-bot 2023-07-27 05:45:53 +00:00 committed by Gitee
commit 6b3e9cc9fd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From 0e06e1110a0ea4fcff9ff3380ad657d80db95305 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Fri, 21 Jul 2023 17:19:50 +0800
Subject: [PATCH] fix ukui-notification-daemon SIGSEGV
---
src/main.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/main.cpp b/src/main.cpp
index 0309f7b..0bc1028 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,6 +36,11 @@
int getScreenWidth() {
Display *disp = XOpenDisplay(NULL);
+ if (disp == NULL) {
+ fprintf(stderr, "Cannot connect to X server\n");
+ return 0;
+ }
+
Screen *scrn = DefaultScreenOfDisplay(disp);
if (NULL == scrn) {
return 0;
--
2.33.0

View File

@ -1,11 +1,12 @@
Name: ukui-notification-daemon Name: ukui-notification-daemon
Version: 3.3.1 Version: 3.3.1
Release: 4 Release: 5
Summary: daemon to display passive popup notifications Summary: daemon to display passive popup notifications
License: GPL-3+ License: GPL-3+
URL: https://github.com/ukui/ukui-notification-daemon URL: https://github.com/ukui/ukui-notification-daemon
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
Patch01: 0001-add-translations-file.patch Patch01: 0001-add-translations-file.patch
Patch02: 0002-fix-ukui-notification-daemon-SIGSEGV.patch
BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtsvg-devel BuildRequires: qt5-qtsvg-devel
@ -38,6 +39,7 @@ Desktop Notifications spec.
%prep %prep
%setup -q %setup -q
%patch01 -p1 %patch01 -p1
%patch02 -p1
%build %build
export PATH=%{_qt5_bindir}:$PATH export PATH=%{_qt5_bindir}:$PATH
@ -63,6 +65,12 @@ popd
%{_datadir}/ukui-notification-daemon/ukui-notification-daemon_zh_CN.qm %{_datadir}/ukui-notification-daemon/ukui-notification-daemon_zh_CN.qm
%changelog %changelog
* Fri Jul 21 2023 peijiankang <peijiankang@kylinos.cn> - 3.3.1-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add Patch2: 0002-fix-ukui-notification-daemon-SIGSEGV.patch
* Tue Mar 14 2023 douyan <douyan@kylinos.cn> - 3.3.1-4 * Tue Mar 14 2023 douyan <douyan@kylinos.cn> - 3.3.1-4
- add Provides: desktop-notification-daemon - add Provides: desktop-notification-daemon