|
From: | Paul Eggert |
Subject: | Re: [PATCH 15/21] freopen: workaround freopen() on OS/2 kLIBC |
Date: | Sun, 30 Nov 2014 11:39:33 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
+#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.
[Prev in Thread] | Current Thread | [Next in Thread] |