dup2: clarify by coalescing Windows-specific material
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 24 Sep 2011 05:04:20 +0000 (22:04 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 24 Sep 2011 05:18:38 +0000 (22:18 -0700)
commit147b1c2c14ba0cfee9ab0da514b8929652ee5bd1
treeacac22186969450f57618a1b4e9eed26a93a5e71
parent78873a29ee594888a4d3a33b71fc6d6b4849dcbe
dup2: clarify by coalescing Windows-specific material

* lib/dup2.c: Move '#include "msvc-inval.h"' and '#include
"msvc-nothrow.h"' to the Windows-specific section, so that the
Emacs source need not contain these include files.
(ms_windows_dup2): Rename from dup2_nothrow, and move all the
Windows-specific fixes into this function rather than just the
nothrow fix, as this shortens and clarifies the code.  Always
define as a function, as that's a bit cleaner than having it be
sometimes a function and sometimes a macro.
(rpl_dup2): Move the Windows-specific stuff out of here and into
ms_windows_dup2.  Don't protect the Haiku-related fix with
"#if !defined __linux__", as the same code also works around
a Linux kernel bug, and it doesn't add any system calls on any
platform.  Add comment about FreeBSD 6.1.
ChangeLog
lib/dup2.c