summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 41bd733ce..f630e8c75 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -183,7 +183,7 @@ getline(Linebuf * lb)
183static int 183static int
184fdlim_get(int hard) 184fdlim_get(int hard)
185{ 185{
186#if defined(HAVE_GETRLIMIT) 186#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE)
187 struct rlimit rlfd; 187 struct rlimit rlfd;
188 if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0) 188 if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
189 return (-1); 189 return (-1);
@@ -201,12 +201,12 @@ fdlim_get(int hard)
201static int 201static int
202fdlim_set(int lim) 202fdlim_set(int lim)
203{ 203{
204#if defined(HAVE_SETRLIMIT) 204#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
205 struct rlimit rlfd; 205 struct rlimit rlfd;
206#endif 206#endif
207 if (lim <= 0) 207 if (lim <= 0)
208 return (-1); 208 return (-1);
209#if defined(HAVE_SETRLIMIT) 209#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
210 if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0) 210 if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
211 return (-1); 211 return (-1);
212 rlfd.rlim_cur = lim; 212 rlfd.rlim_cur = lim;