Ticket Change Details
Not logged in
Overview

Artifact ID: d164ad18ab91df4ab72a74d6ac7388994b50641b
Ticket: 6585b6c5d9058212cebc4523012344858f099c1c
Wrong cast in call to _open_osfhandle
User & Date: anonymous 2011-01-14 13:59:39
Changes

  1. comment changed to:
    According to Microsoft, _open_osfhandle is declared as follows:
    
    <verbatim>
      int _open_osfhandle (
        intptr_t osfhandle,
        int flags 
      );
    </verbatim>
    
    However, Fossil currently calls this function as follow:
    
    <verbatim>
        *pfdIn = _open_osfhandle((long)hStdoutRd, 0);
        fd = _open_osfhandle((long)hStdinWr, 0);
    </verbatim>
    
    The cast to long is causing trouble, because on x86_64-windows,
    long is still 32bit, whereas intptr_t is 64bit.
    
    The attached patch fixes this.
    
    -- tsbg
    
  2. foundin changed to: "[4ab7251fcd]"
  3. private_contact changed to: "76518fb407f147a1d053c00b5b993281a339c0e3"
  4. severity changed to: "Severe"
  5. status changed to: "Open"
  6. title changed to: "Wrong cast in call to _open_osfhandle"
  7. type changed to: "Code_Defect"