// Logging
int log_INFO[2];
int log_ERROR[2];
+#ifdef ENABLE_DEBUG
int log_DEBUG[2];
+#endif /* ENABLE_DEBUG */
} pipes;
// Communicate
// Logging
struct pakfire_log_buffer log_INFO;
struct pakfire_log_buffer log_ERROR;
+#ifdef ENABLE_DEBUG
struct pakfire_log_buffer log_DEBUG;
+#endif /* ENABLE_DEBUG */
} buffers;
struct pakfire_cgroup* cgroup;
// Logging
const int log_INFO = pakfire_jail_get_pipe_to_read(jail, &ctx->pipes.log_INFO);
const int log_ERROR = pakfire_jail_get_pipe_to_read(jail, &ctx->pipes.log_ERROR);
+#ifdef ENABLE_DEBUG
const int log_DEBUG = pakfire_jail_get_pipe_to_read(jail, &ctx->pipes.log_DEBUG);
+#endif /* ENABLE_DEBUG */
// Signals
const int signalfd = pakfire_jail_handle_signals(jail);
// Make a list of all file descriptors we are interested in
const int fds[] = {
- stdin, stdout, stderr, pidfd, timerfd, signalfd, log_INFO, log_ERROR, log_DEBUG,
+ stdin,
+ stdout,
+ stderr,
+ pidfd,
+ timerfd,
+ signalfd,
+ log_INFO,
+ log_ERROR,
+#ifdef ENABLE_DEBUG
+ log_DEBUG,
+#endif /* ENABLE_DEBUG */
};
// Setup epoll
callback = pakfire_jail_log;
+#ifdef ENABLE_DEBUG
} else if (fd == log_DEBUG) {
buffer = &ctx->buffers.log_DEBUG;
priority = LOG_DEBUG;
callback = pakfire_jail_log;
+#endif /* ENABLE_DEBUG */
// Handle anything from the log pipes
} else if (fd == stdout) {
.stderr = { -1, -1 },
.log_INFO = { -1, -1 },
.log_ERROR = { -1, -1 },
+#ifdef ENABLE_DEBUG
.log_DEBUG = { -1, -1 },
+#endif /* ENABLE_DEBUG */
},
.communicate = {
close(ctx.pidfd);
pakfire_jail_close_pipe(jail, ctx.pipes.log_INFO);
pakfire_jail_close_pipe(jail, ctx.pipes.log_ERROR);
+#ifdef ENABLE_DEBUG
pakfire_jail_close_pipe(jail, ctx.pipes.log_DEBUG);
+#endif /* ENABLE_DEBUG */
return exit;
}