1.1 --- a/fsaccess/op_run.c Sun May 26 22:18:20 2024 +0200
1.2 +++ b/fsaccess/op_run.c Tue May 28 18:57:53 2024 +0200
1.3 @@ -262,9 +262,8 @@
1.4 return -1;
1.5 }
1.6
1.7 - /* Release the relinquished end of the pipes. */
1.8 + /* Release the relinquished end of the output pipe. */
1.9
1.10 - client_close(input_reader);
1.11 client_close(output_writer);
1.12
1.13 /* Record the output stream, process and command details. */
1.14 @@ -283,6 +282,7 @@
1.15 int file_to_program(int argc, char *argv[])
1.16 {
1.17 file_t *reader;
1.18 + int exitcode;
1.19
1.20 /* Obtain a file reader and run the program with this as its input reader. */
1.21
1.22 @@ -297,7 +297,12 @@
1.23 return -1;
1.24 }
1.25
1.26 - return _run_program(argc - 1, &argv[1], reader);
1.27 + exitcode = _run_program(argc - 1, &argv[1], reader);
1.28 +
1.29 + /* Close the file now that the program should be able to read it. */
1.30 +
1.31 + client_close(reader);
1.32 + return exitcode;
1.33 }
1.34
1.35 /* Run the given program, connecting input from another program. */