From 2358bd53b07a7672c2abb4e0b41d81e17b287df8 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 19 Dec 2023 14:25:54 +0000 Subject: [PATCH] jail: Remove duplicate logging function There were two functions essentially doing the same, so one can go. Signed-off-by: Michael Tremer --- src/libpakfire/jail.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/libpakfire/jail.c b/src/libpakfire/jail.c index bb0377505..72341b3bc 100644 --- a/src/libpakfire/jail.c +++ b/src/libpakfire/jail.c @@ -884,14 +884,6 @@ static int pakfire_jail_get_pipe_to_write(struct pakfire_jail* jail, int (*fds)[ return -1; } -static int pakfire_jail_log(struct pakfire* pakfire, void* data, int priority, - const char* line, const size_t length) { - // Pass everything to the parent logger - pakfire_log_condition(pakfire, priority, 0, "%.*s", (int)length, line); - - return 0; -} - static int pakfire_jail_epoll_add_fd(struct pakfire_jail* jail, int epollfd, int fd, int events) { struct epoll_event event = { .events = events|EPOLLHUP, @@ -1338,7 +1330,7 @@ static int pakfire_jail_wait(struct pakfire_jail* jail, struct pakfire_jail_exec } else if (log_INFO == fd) { if (e & EPOLLIN) { r = pakfire_jail_handle_log(jail, ctx, LOG_INFO, fd, - &ctx->buffers.log_INFO, pakfire_jail_log, NULL); + &ctx->buffers.log_INFO, pakfire_jail_default_log_callback, NULL); if (r) goto ERROR; } @@ -1347,7 +1339,7 @@ static int pakfire_jail_wait(struct pakfire_jail* jail, struct pakfire_jail_exec } else if (log_ERROR == fd) { if (e & EPOLLIN) { r = pakfire_jail_handle_log(jail, ctx, LOG_ERR, fd, - &ctx->buffers.log_ERROR, pakfire_jail_log, NULL); + &ctx->buffers.log_ERROR, pakfire_jail_default_log_callback, NULL); if (r) goto ERROR; } @@ -1357,7 +1349,7 @@ static int pakfire_jail_wait(struct pakfire_jail* jail, struct pakfire_jail_exec } else if (log_DEBUG == fd) { if (e & EPOLLIN) { r = pakfire_jail_handle_log(jail, ctx, LOG_DEBUG, fd, - &ctx->buffers.log_DEBUG, pakfire_jail_log, NULL); + &ctx->buffers.log_DEBUG, pakfire_jail_default_log_callback, NULL); if (r) goto ERROR; } -- 2.47.3