]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/pager: Remove unused struct field "out"
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 19 Jan 2026 18:02:50 +0000 (19:02 +0100)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 20 Jan 2026 16:36:45 +0000 (17:36 +0100)
The struct field `out` is never set, thus always 0. Since the pager
output is never redirected, this functionality stub can be removed.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
lib/pager.c

index c3b42d19ee0ebadcd67db18e05490906cfe28af1..39a2ccb1cff815fc83c78d036fb9967a8365f306 100644 (file)
@@ -34,7 +34,6 @@ struct child_process {
        const char **argv;
        pid_t pid;
        int in;
-       int out;
        int err;
 
        int org_err;
@@ -62,16 +61,13 @@ static int start_command(struct child_process *cmd)
        int fdin[2];
 
        /*
-        * In case of errors we must keep the promise to close FDs
-        * that have been passed in via ->in and ->out.
+        * In case of errors we must keep the promise to close FD
+        * that has been passed in via ->in.
         */
        need_in = !cmd->no_stdin && cmd->in < 0;
        if (need_in) {
-               if (pipe(fdin) < 0) {
-                       if (cmd->out > 0)
-                               close(cmd->out);
+               if (pipe(fdin) < 0)
                        return -1;
-               }
                cmd->in = fdin[1];
        }