]> git.ipfire.org Git - pakfire.git/commitdiff
jail: Remove duplicate logging function
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 19 Dec 2023 14:25:54 +0000 (14:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 19 Dec 2023 14:25:54 +0000 (14:25 +0000)
There were two functions essentially doing the same, so one can go.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/jail.c

index bb0377505633879107c724b3c6d9dcb6e6302053..72341b3bcc9f7edccebf6b63c77190c412b9751b 100644 (file)
@@ -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;
                                }