return r;
}
+static int pakfire_build_log_callback(struct pakfire* pakfire,
+ void* data, int priority, const char* line, size_t length) {
+ struct pakfire_build* build = data;
+ char buffer[128];
+ int r;
+
+ // Get the runtime of the build
+ const time_t t = pakfire_build_duration(build);
+ if (t < 0)
+ return t;
+
+ // Format the timestamp
+ r = pakfire_string_format(buffer, "%8ld", t);
+ if (r < 0)
+ return r;
+
+ // Pass the message to the upstream logger
+ pakfire_log_condition(pakfire, priority, 0, "[%s] %s", buffer, line);
+
+ return 0;
+}
+
/*
Sets up a new jail for this build
*/
return r;
}
+ // Configure our custom logging callback
+ pakfire_jail_set_log_callback(build->jail, pakfire_build_log_callback, build);
+
// Connect the jail to our cgroup
r = pakfire_jail_set_cgroup(build->jail, build->cgroup);
if (r) {