diff -Nru orig/processx/src/client.c patched/processx/src/client.c
--- orig/processx/src/client.c	2021-11-17 11:27:01.000000000 +0100
+++ patched/processx/src/client.c	2022-05-09 13:05:43.456573900 +0200
@@ -207,8 +207,7 @@
   if (fd == -1) {
     R_THROW_SYSTEM_ERROR("Cannot open new stdout file `%s`", c_file);
   }
-  SEXP ret = processx_set_std(1, fd, 0);
-  close(fd);
+  SEXP ret = processx_set_std(1, fd, 0); /* closes fd */
   return ret;
 }
 
@@ -222,8 +221,7 @@
   if (fd == -1) {
     R_THROW_SYSTEM_ERROR("Cannot open new stderr file `%s`", c_file);
   }
-  SEXP ret = processx_set_std(2, fd, 0);
-  close(fd);
+  SEXP ret = processx_set_std(2, fd, 0); /* closes fd */
   return ret;
 }
 
