// libuuid
#include <uuid.h>
+// systemd
+#include <systemd/sd-event.h>
+
#include <pakfire/arch.h>
#include <pakfire/cgroup.h>
#include <pakfire/jail.h>
};
struct pakfire_jail_exec {
+ sd_event* loop;
int flags;
// PID (of the child)
CTX_DEBUG(jail->ctx, "Executing jail...\n");
+ // Create a new event loop
+ r = sd_event_new(&ctx.loop);
+ if (r < 0) {
+ CTX_ERROR(jail->ctx, "Could not create a new event loop: %s\n", strerror(-r));
+ goto ERROR;
+ }
+
// Enable networking in interactive mode
if (ctx.flags & PAKFIRE_JAIL_PTY_FORWARDING)
ctx.flags |= PAKFIRE_JAIL_HAS_NETWORKING;
#endif /* ENABLE_DEBUG */
pakfire_jail_close_pipe(jail, ctx.socket);
+ if (ctx.loop)
+ sd_event_unref(ctx.loop);
+
return exit;
}