* Maybe merge nss-myhostname into systemd?
-* ensure we strip empty directories from search path
-
* GC unreferenced jobs (such as .device jobs)
* support wildcard expansion in ListenStream= and friends
return -ENOMEM;
strv_uniq(p->unit_path);
+ strv_path_remove_empty(p->unit_path);
if (!strv_isempty(p->unit_path)) {
strv_uniq(p->sysvinit_path);
strv_uniq(p->sysvrcnd_path);
+ strv_path_remove_empty(p->sysvinit_path);
+ strv_path_remove_empty(p->sysvrcnd_path);
+
if (!strv_isempty(p->sysvinit_path)) {
if (!(t = strv_join(p->sysvinit_path, "\n\t")))
return l;
}
+char **strv_path_remove_empty(char **l) {
+ char **f, **t;
+
+ if (!l)
+ return NULL;
+
+ for (f = t = l; *f; f++) {
+
+ if (dir_is_empty(*f) > 0) {
+ free(*f);
+ continue;
+ }
+
+ *(t++) = *f;
+ }
+
+ *t = NULL;
+ return l;
+}
+
int reset_all_signal_handlers(void) {
int sig;
char **strv_path_make_absolute_cwd(char **l);
char **strv_path_canonicalize(char **l);
+char **strv_path_remove_empty(char **l);
int reset_all_signal_handlers(void);