 -         VG_(log_output_sink).fd = tmp_log_fd;
 -         VG_(fcntl)(VG_(log_output_sink).fd, VKI_F_SETFD, VKI_FD_CLOEXEC);
 -      }
-+      VG_(log_output_sink).fd = tmp_log_fd = VG_(safe_fd)(tmp_log_fd);
++      tmp_log_fd = move_fd_into_safe_range(tmp_log_fd, False);
     } else {
        // If they said --log-fd=-1, don't print anything.  Plausible for use in
        // regression testing suites that use client requests to count errors.
-@@ -886,18 +872,7 @@
+@@ -886,18 +888,7 @@
     // Finalise the output fds: and the XML fd ..
  
     if (tmp_xml_fd >= 0) {

 {
    Int    i;
    HChar* xpre  = VG_(clo_xml) ? "  <line>" : "";
@@ -999,9 +977,15 @@
    UInt (*umsg_or_xml)( const HChar*, ... )
       = VG_(clo_xml) ? VG_(printf_xml) : VG_(umsg);
 

          break;
       }
 
@@ -864,18 +877,7 @@
    // Finalise the output fds: the log fd ..
 
    if (tmp_log_fd >= 0) {
