X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fdbus1-generator%2Fdbus1-generator.c;h=e1ffc5515f0deecb286b425b1751f4f7600f303d;hb=4c94096027f21d4ed0efe991534a926d39d52369;hp=ba2953014d73aa790ee687ff6ebd65e46e44eaa8;hpb=e9f3d2d508bfd9fb5b54e82994bda365a71eb864;p=elogind.git diff --git a/src/dbus1-generator/dbus1-generator.c b/src/dbus1-generator/dbus1-generator.c index ba2953014..e1ffc5515 100644 --- a/src/dbus1-generator/dbus1-generator.c +++ b/src/dbus1-generator/dbus1-generator.c @@ -163,27 +163,17 @@ static int add_dbus(const char *path, const char *fname, const char *type) { { "D-BUS Service", "SystemdService", config_parse_string, 0, &service }, }; - _cleanup_fclose_ FILE *f = NULL; - _cleanup_free_ char *p = NULL; + char *p; int r; assert(path); assert(fname); - p = strjoin(path, "/", fname, NULL); - if (!p) - return log_oom(); - - f = fopen(p, "re"); - if (!f) { - if (errno == -ENOENT) - return 0; - - log_error("Failed to read %s: %m", p); - return -errno; - } - - r = config_parse(NULL, p, f, "D-BUS Service\0", config_item_table_lookup, table, true, false, NULL); + p = strappenda(path, "/", fname); + r = config_parse(NULL, p, NULL, + "D-BUS Service\0", + config_item_table_lookup, table, + true, false, true, NULL); if (r < 0) return r;