]>
git.ipfire.org Git - thirdparty/systemd.git/blob - load-dropin.c
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
7 #include "load-dropin.h"
9 int unit_load_dropin(Unit
*u
) {
16 /* Load dependencies from supplementary drop-in directories */
18 SET_FOREACH(t
, u
->meta
.names
, i
) {
23 if (asprintf(&path
, "%s/%s.wants", unit_path(), t
) < 0)
26 if (!(d
= opendir(path
))) {
38 while ((de
= readdir(d
))) {
41 if (de
->d_name
[0] == '.')
44 assert(de
->d_name
[0]);
46 if (de
->d_name
[strlen(de
->d_name
)-1] == '~')
49 if (asprintf(&path
, "%s/%s.wants/%s", unit_path(), t
, de
->d_name
) < 0) {
54 r
= manager_load_unit(u
->meta
.manager
, path
, &other
);
62 if ((r
= unit_add_dependency(u
, UNIT_WANTS
, other
)) < 0) {