Merge pull request #26447 from poettering/sigqueue

pid1/systemctl: add ability to enqueue POSIX RT sigs with associated value to service processes
This commit is contained in:
Lennart Poettering
2023-02-17 10:51:58 +01:00
committed by GitHub
26 changed files with 442 additions and 130 deletions
+8 -2
View File
@@ -77,20 +77,26 @@ char** strv_free_erase(char **l) {
return mfree(l);
}
char** strv_copy(char * const *l) {
char** strv_copy_n(char * const *l, size_t m) {
_cleanup_strv_free_ char **result = NULL;
char **k;
result = new(char*, strv_length(l) + 1);
result = new(char*, MIN(strv_length(l), m) + 1);
if (!result)
return NULL;
k = result;
STRV_FOREACH(i, l) {
if (m == 0)
break;
*k = strdup(*i);
if (!*k)
return NULL;
k++;
if (m != SIZE_MAX)
m--;
}
*k = NULL;
+4 -1
View File
@@ -29,7 +29,10 @@ char** strv_free_erase(char **l);
DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free_erase);
#define _cleanup_strv_free_erase_ _cleanup_(strv_free_erasep)
char** strv_copy(char * const *l);
char** strv_copy_n(char * const *l, size_t n);
static inline char** strv_copy(char * const *l) {
return strv_copy_n(l, SIZE_MAX);
}
size_t strv_length(char * const *l) _pure_;
int strv_extend_strv(char ***a, char * const *b, bool filter_duplicates);