 -         VG_(xml_output_sink).fd = tmp_xml_fd;
 -         VG_(fcntl)(VG_(xml_output_sink).fd, VKI_F_SETFD, VKI_FD_CLOEXEC);
 -      }
-+      VG_(xml_output_sink).fd = tmp_xml_fd = VG_(safe_fd)(tmp_xml_fd);
++      tmp_xml_fd = move_fd_into_safe_range(tmp_xml_fd, True);
     } else {
        // If they said --xml-fd=-1, don't print anything.  Plausible for use in
        // regression testing suites that use client requests to count errors.
-@@ -989,9 +964,12 @@
+@@ -989,9 +980,12 @@
     If logging to file or a socket, write details of parent PID and
     command line args, to help people trying to interpret the
     results of a run which encompasses multiple processes. */

 
       if (VG_(clo_xml))
          VG_(printf_xml)("<preamble>\n");
@@ -1067,6 +1051,7 @@
    }
    else
    if (VG_(clo_xml)) {

===================================================================
--- coregrind/m_main.c	(revision 10880)
+++ coregrind/m_main.c	(working copy)
@@ -313,6 +313,64 @@
    }
 }
 
