/* Accept a connection on a socket, with specific opening flags.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <errno.h>
#include <fcntl.h>
#include "binary-io.h"
+#include "msvc-nothrow.h"
#ifndef SOCK_CLOEXEC
# define SOCK_CLOEXEC 0
#if SOCK_CLOEXEC
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Native Woe32 API. */
+/* Native Windows API. */
if (flags & SOCK_CLOEXEC)
{
HANDLE curr_process = GetCurrentProcess ();
/* Closing fd before allocating the new fd ensures that the new fd will
have the minimum possible value. */
close (fd);
- nfd = _open_osfhandle ((long) new_handle,
+ nfd = _open_osfhandle ((intptr_t) new_handle,
O_NOINHERIT | (flags & (O_TEXT | O_BINARY)));
if (nfd < 0)
{