return systemd_service_init(n, s);
}
-int systemd_service_init(const char *name, struct systemd_service *s)
+int systemd_service_init(const char *dbus_path, struct systemd_service *s)
{
- assert(name);
+ assert(dbus_path);
assert(s);
- s->name = strdup(name);
+ s->dbus_path = strdup(dbus_path);
return 0;
}
void systemd_service_cleanup(struct systemd_service *s)
{
if (s)
- free(s->name);
+ free(s->dbus_path);
}
int systemd_get_unit_by_pid(pid_t pid, const char **name)
#include <unistd.h>
struct systemd_service {
- char *name;
+ char *dbus_path;
};
int systemd_service_init_by_pid(pid_t pid, struct systemd_service *s);
-int systemd_service_init(const char *name, struct systemd_service *s);
+int systemd_service_init(const char *dbus_path, struct systemd_service *s);
void systemd_service_cleanup(struct systemd_service *s);
int systemd_get_unit_by_pid(pid_t pid, const char **name);
};
int ret;
- ev_data.action_data = strdup(rv_ev->service.name);
+ ev_data.action_data = strdup(rv_ev->service.dbus_path);
if (!ev_data.action_data) {
log_error("Unable to duplicate service name");
faultd_event_unref(ev);
/* TODO print other fields */
ret = asprintf(&str, "Resource Violation Event:"
" Time: %lld.%.9ld"
- " Service: pid: %d, name %s"
+ " Service: pid: %d, path %s"
" Resource type: %d",
(long long)rv_ev->event.timestamp.tv_sec,
rv_ev->event.timestamp.tv_nsec,
rv_ev->pid,
- rv_ev->service.name,
+ rv_ev->service.dbus_path,
rv_ev->resource_type);
return ret > 0 ? str : NULL;
/* TODO print other fields */
ret = asprintf(&str, "Service Failed Event:"
" Time: %lld.%.9ld"
- " Service: name %s",
+ " Service: path %s",
(long long)sf_ev->event.timestamp.tv_sec,
sf_ev->event.timestamp.tv_nsec,
- sf_ev->service.name);
+ sf_ev->service.dbus_path);
return ret > 0 ? str : NULL;
}