[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 15/21] freopen: workaround freopen() on OS/2 kLIBC
From: |
KO Myung-Hun |
Subject: |
Re: [PATCH 15/21] freopen: workaround freopen() on OS/2 kLIBC |
Date: |
Tue, 02 Dec 2014 15:50:34 +0900 |
User-agent: |
Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.6esrpre) Gecko/20120715 Firefox/10.0.6esrpre SeaMonkey/2.7.2 |
Hi/2.
Paul Eggert wrote:
> I don't see why the workaround must be in freopen-safer.c.
> freopen-safer has freopen as a prerequisite, so it can assume that
> freopen doesn't have the bug in question.
>
Unfortunately, if freopen is not replaced by gnulib, freopen-safer also
has a bug.
>> +#ifdef __KLIBC__
>> + FILE *result = freopen (filename, mode, stream);
>> +
>> + /* On OS/2 kLIBC, freopen() returns NULL even if it is successful
>> + if filename is NULL. */
>> + if (!result && !errno)
>> + result = stream;
>> +
>> + return result;
>> +#else
>> return freopen (filename, mode, stream);
>> +#endif
>
> This should be refactored so that there's only one call to freopen, to
> avoid duplicating the code.
Ok.
--
KO Myung-Hun
Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM
Korean OS/2 User Community : http://www.ecomstation.co.kr
- Re: [PATCH 15/21] freopen: workaround freopen() on OS/2 kLIBC,
KO Myung-Hun <=