aboutsummaryrefslogtreecommitdiffstats
path: root/jnlib/w32-afunix.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--jnlib/w32-afunix.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/jnlib/w32-afunix.c b/jnlib/w32-afunix.c
index 84d799f1f..dcce423c7 100644
--- a/jnlib/w32-afunix.c
+++ b/jnlib/w32-afunix.c
@@ -1,27 +1,29 @@
-/* w32-afunix.c
- * Copyright (C) 2004 g10 Code GmbH
+/* w32-afunix.c - AF_UNIX emulation for Windows.
+ * Copyright (C) 2004, 2006 g10 Code GmbH
*
- * This file is part of GnuPG.
+ * This file is part of JNLIB.
*
- * GnuPG is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * JNLIB is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
*
- * GnuPG is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * JNLIB is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser 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.
+ * You should have received a copy of the GNU Lesser 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.
*/
+
#ifdef _WIN32
#include <stdio.h>
#include <windows.h>
#include <io.h>
+#include <errno.h>
#include "w32-afunix.h"
@@ -59,9 +61,11 @@ _w32_sock_connect (int sockfd, struct sockaddr * addr, int addrlen)
fscanf (fp, "%d", &port);
fclose (fp);
- /* XXX: set errno in this case */
if (port < 0 || port > 65535)
- return -1;
+ {
+ errno = EINVAL;
+ return -1;
+ }
myaddr.sin_family = AF_INET;
myaddr.sin_port = port;