From efc2eee3a7588f4f97d6590b08397a884b97eab5 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Tue, 16 Jun 2026 05:21:08 +0000 Subject: [PATCH] refactor(signal-util,time-util): trivial cleanups for signal table and usleep_safe Align the static_signal_table[] array elements by adding whitespace to make the assignment operators line up vertically. Make usleep_safe() return immediately if the requested delay is zero, avoiding an unnecessary clock_nanosleep() syscall. Changes: - Add debian/patches/refactor-signal-time-util-trivial-cleanups.patch - Remove debian/patches/fix-signal-util-align-table.patch - Modify debian/patches/series - Modify debian/changelog Upstream: https://github.com/systemd/systemd/pull/30531 Generated-By: glm-5-turbo Co-Authored-By: deepin-ci-robot --- debian/changelog | 6 + ...or-signal-time-util-trivial-cleanups.patch | 108 ++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 115 insertions(+) create mode 100644 debian/patches/refactor-signal-time-util-trivial-cleanups.patch diff --git a/debian/changelog b/debian/changelog index 569979b5..8906493b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +systemd (255.2-4deepin37) unstable; urgency=medium + + * Align signal table formatting and make usleep_safe() return early for zero delay + + -- deepin-ci-robot Tue, 16 Jun 2026 05:45:55 +0800 + systemd (255.2-4deepin36) unstable; urgency=medium * fix wrong error variable in log_error_errno() diff --git a/debian/patches/refactor-signal-time-util-trivial-cleanups.patch b/debian/patches/refactor-signal-time-util-trivial-cleanups.patch new file mode 100644 index 00000000..1582f18b --- /dev/null +++ b/debian/patches/refactor-signal-time-util-trivial-cleanups.patch @@ -0,0 +1,108 @@ +From 5d889f3ab87e6b2458e4039d6b9ceb4edb32dbf2 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Wed, 20 Dec 2023 00:54:10 +0900 +Subject: [PATCH] signal-util: align table + + +diff --git a/src/basic/signal-util.c b/src/basic/signal-util.c +index 5d9484626d..f8f4e509ad 100644 +--- a/src/basic/signal-util.c ++++ b/src/basic/signal-util.c +@@ -120,39 +120,39 @@ int sigprocmask_many(int how, sigset_t *old, ...) { + } + + static const char *const static_signal_table[] = { +- [SIGHUP] = "HUP", +- [SIGINT] = "INT", +- [SIGQUIT] = "QUIT", +- [SIGILL] = "ILL", +- [SIGTRAP] = "TRAP", +- [SIGABRT] = "ABRT", +- [SIGBUS] = "BUS", +- [SIGFPE] = "FPE", +- [SIGKILL] = "KILL", +- [SIGUSR1] = "USR1", +- [SIGSEGV] = "SEGV", +- [SIGUSR2] = "USR2", +- [SIGPIPE] = "PIPE", +- [SIGALRM] = "ALRM", +- [SIGTERM] = "TERM", ++ [SIGHUP] = "HUP", ++ [SIGINT] = "INT", ++ [SIGQUIT] = "QUIT", ++ [SIGILL] = "ILL", ++ [SIGTRAP] = "TRAP", ++ [SIGABRT] = "ABRT", ++ [SIGBUS] = "BUS", ++ [SIGFPE] = "FPE", ++ [SIGKILL] = "KILL", ++ [SIGUSR1] = "USR1", ++ [SIGSEGV] = "SEGV", ++ [SIGUSR2] = "USR2", ++ [SIGPIPE] = "PIPE", ++ [SIGALRM] = "ALRM", ++ [SIGTERM] = "TERM", + #ifdef SIGSTKFLT + [SIGSTKFLT] = "STKFLT", /* Linux on SPARC doesn't know SIGSTKFLT */ + #endif +- [SIGCHLD] = "CHLD", +- [SIGCONT] = "CONT", +- [SIGSTOP] = "STOP", +- [SIGTSTP] = "TSTP", +- [SIGTTIN] = "TTIN", +- [SIGTTOU] = "TTOU", +- [SIGURG] = "URG", +- [SIGXCPU] = "XCPU", +- [SIGXFSZ] = "XFSZ", ++ [SIGCHLD] = "CHLD", ++ [SIGCONT] = "CONT", ++ [SIGSTOP] = "STOP", ++ [SIGTSTP] = "TSTP", ++ [SIGTTIN] = "TTIN", ++ [SIGTTOU] = "TTOU", ++ [SIGURG] = "URG", ++ [SIGXCPU] = "XCPU", ++ [SIGXFSZ] = "XFSZ", + [SIGVTALRM] = "VTALRM", +- [SIGPROF] = "PROF", +- [SIGWINCH] = "WINCH", +- [SIGIO] = "IO", +- [SIGPWR] = "PWR", +- [SIGSYS] = "SYS" ++ [SIGPROF] = "PROF", ++ [SIGWINCH] = "WINCH", ++ [SIGIO] = "IO", ++ [SIGPWR] = "PWR", ++ [SIGSYS] = "SYS" + }; + + DEFINE_PRIVATE_STRING_TABLE_LOOKUP(static_signal, int); + +From 97df9fa065767cbedadd144b0e1b193a95e7ffbd Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Wed, 20 Dec 2023 00:48:49 +0900 +Subject: [PATCH] time-util: make usleep_safe() return earlier if 0 is passed + + +diff --git a/src/basic/time-util.h b/src/basic/time-util.h +index ed4c1aabd4..29373477f4 100644 +--- a/src/basic/time-util.h ++++ b/src/basic/time-util.h +@@ -219,6 +219,9 @@ static inline int usleep_safe(usec_t usec) { + * ⚠️ Note we are not using plain nanosleep() here, since that operates on CLOCK_REALTIME, not + * CLOCK_MONOTONIC! */ + ++ if (usec == 0) ++ return 0; ++ + // FIXME: use RET_NERRNO() macro here. Currently, this header cannot include errno-util.h. + return clock_nanosleep(CLOCK_MONOTONIC, 0, TIMESPEC_STORE(usec), NULL) < 0 ? -errno : 0; + } + +From 08542781e27d4a7e3d1aa80e33a442be86681b2f Mon Sep 17 00:00:00 2001 +From: Luca Boccassi +Date: Tue, 19 Dec 2023 23:19:25 +0100 +Subject: [PATCH] Merge pull request #30531 from yuwata/trivial-cleanups + +Trivial cleanups + diff --git a/debian/patches/series b/debian/patches/series index f669e803..f90f199c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -47,3 +47,4 @@ fix-byte-order-conversion.patch update-po-file-about-bo-and-ug.patch fix-double-free.patch fix-wrong-err-log.patch +refactor-signal-time-util-trivial-cleanups.patch