summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authordtucker <dtucker>2007-12-28 15:43:51 +0000
committerdtucker <dtucker>2007-12-28 15:43:51 +0000
commit3dc41e8d9136ace9301c67db9f3985fe8112b4fe (patch)
tree88618edbfc9c1d82a8b9dff72121767e05e9a87e /misc.c
parent40d2e5ad4a0514d5fa63c1472e9a667e7f497c94 (diff)
downloadopenssh-3dc41e8d9136ace9301c67db9f3985fe8112b4fe.tar.gz
- dtucker@cvs.openbsd.org 2007/12/27 14:22:08
[servconf.c canohost.c misc.c channels.c sshconnect.c misc.h ssh-keyscan.c sshd.c] Add a small helper function to consistently handle the EAI_SYSTEM error code of getaddrinfo. Prompted by vgiffin at apple com via bz #1417. ok markus@ stevesk@
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index 625a3436..2ca0414d 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.65 2006/11/23 01:35:11 ray Exp $ */
+/* $OpenBSD: misc.c,v 1.66 2007/12/27 14:22:08 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -42,6 +42,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <netdb.h>
#ifdef HAVE_PATHS_H
# include <paths.h>
#include <pwd.h>
@@ -120,6 +121,14 @@ unset_nonblock(int fd)
return (0);
}
+const char *
+ssh_gai_strerror(int gaierr)
+{
+ if (gaierr == EAI_SYSTEM)
+ return strerror(errno);
+ return gai_strerror(gaierr);
+}
+
/* disable nagle on socket */
void
set_nodelay(int fd)