Displaying 1 result from an estimated 1 matches for "a46a382".
Did you mean:
646382
2015 May 26
2
[PATCH] api: Don't truncate /dev/stdout or /dev/stderr when used as FileOut.
...- * least.
- *)
- g#download logfile "/dev/stderr"
+ try g#download logfile "/dev/stderr"
with exn ->
warning (f_"log file %s: %s (ignored)") logfile (Printexc.to_string exn) in
diff --git a/src/proto.c b/src/proto.c
index a019625..a46a382 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -756,9 +756,18 @@ guestfs_int_recv_file (guestfs_h *g, const char *filename)
g->user_cancel = 0;
- fd = open (filename, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, 0666);
+ /* If downloading to /dev/stdout or /dev/stderr, dup the file
+ *...