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:
+8
-2
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user