Fossil

View Ticket
Login
Ticket Hash: 6585b6c5d9058212cebc4523012344858f099c1c
Title: Wrong cast in call to _open_osfhandle
Status: Fixed Type: Code_Defect
Severity: Severe Priority:
Subsystem: Resolution: Fixed
Last Modified: 2011-01-14 17:00:17
Version Found In: [4ab7251fcd]
Description:
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

Attachments: