summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ssh-keyscan.c24
2 files changed, 19 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index b9bc2fb73..a36768081 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,12 @@
120010305 120010305
2 - (bal) CVS ID touch up on sshpty.[ch] and sshlogin.[ch] 2 - (bal) CVS ID touch up on sshpty.[ch] and sshlogin.[ch]
3 - OpenBSD CVS Sync 3 - (bal) OpenBSD CVS Sync
4 - deraadt@cvs.openbsd.org 2001/02/17 23:48:48 4 - deraadt@cvs.openbsd.org 2001/02/17 23:48:48
5 [sshd.8] 5 [sshd.8]
6 it's the OpenSSH one 6 it's the OpenSSH one
7 7 - deraadt@cvs.openbsd.org 2001/02/21 07:37:04
8 [ssh-keyscan.c]
9 inline -> __inline__, and some indent
8 10
920010304 1120010304
10 - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid. 12 - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid.
@@ -4197,4 +4199,4 @@
4197 - Wrote replacements for strlcpy and mkdtemp 4199 - Wrote replacements for strlcpy and mkdtemp
4198 - Released 1.0pre1 4200 - Released 1.0pre1
4199 4201
4200$Id: ChangeLog,v 1.852 2001/03/05 04:47:55 mouring Exp $ 4202$Id: ChangeLog,v 1.853 2001/03/05 04:54:49 mouring Exp $
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 5cd368e93..a8fb028d8 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include "includes.h" 10#include "includes.h"
11RCSID("$OpenBSD: ssh-keyscan.c,v 1.16 2001/02/12 22:56:10 deraadt Exp $"); 11RCSID("$OpenBSD: ssh-keyscan.c,v 1.17 2001/02/21 07:37:04 deraadt Exp $");
12 12
13#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) 13#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
14#include <sys/queue.h> 14#include <sys/queue.h>
@@ -89,7 +89,7 @@ typedef struct {
89 void (*errfun) (const char *,...); 89 void (*errfun) (const char *,...);
90} Linebuf; 90} Linebuf;
91 91
92static inline Linebuf * 92static __inline__ Linebuf *
93Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) 93Linebuf_alloc(const char *filename, void (*errfun) (const char *,...))
94{ 94{
95 Linebuf *lb; 95 Linebuf *lb;
@@ -123,7 +123,7 @@ Linebuf_alloc(const char *filename, void (*errfun) (const char *,...))
123 return (lb); 123 return (lb);
124} 124}
125 125
126static inline void 126static __inline__ void
127Linebuf_free(Linebuf * lb) 127Linebuf_free(Linebuf * lb)
128{ 128{
129 fclose(lb->stream); 129 fclose(lb->stream);
@@ -131,7 +131,7 @@ Linebuf_free(Linebuf * lb)
131 xfree(lb); 131 xfree(lb);
132} 132}
133 133
134static inline void 134static __inline__ void
135Linebuf_restart(Linebuf * lb) 135Linebuf_restart(Linebuf * lb)
136{ 136{
137 clearerr(lb->stream); 137 clearerr(lb->stream);
@@ -139,13 +139,13 @@ Linebuf_restart(Linebuf * lb)
139 lb->lineno = 0; 139 lb->lineno = 0;
140} 140}
141 141
142static inline int 142static __inline__ int
143Linebuf_lineno(Linebuf * lb) 143Linebuf_lineno(Linebuf * lb)
144{ 144{
145 return (lb->lineno); 145 return (lb->lineno);
146} 146}
147 147
148static inline char * 148static __inline__ char *
149Linebuf_getline(Linebuf * lb) 149Linebuf_getline(Linebuf * lb)
150{ 150{
151 int n = 0; 151 int n = 0;
@@ -155,7 +155,8 @@ Linebuf_getline(Linebuf * lb)
155 /* Read a line */ 155 /* Read a line */
156 if (!fgets(&lb->buf[n], lb->size - n, lb->stream)) { 156 if (!fgets(&lb->buf[n], lb->size - n, lb->stream)) {
157 if (ferror(lb->stream) && lb->errfun) 157 if (ferror(lb->stream) && lb->errfun)
158 (*lb->errfun) ("%s: %s\n", lb->filename, strerror(errno)); 158 (*lb->errfun) ("%s: %s\n", lb->filename,
159 strerror(errno));
159 return (NULL); 160 return (NULL);
160 } 161 }
161 n = strlen(lb->buf); 162 n = strlen(lb->buf);
@@ -167,13 +168,15 @@ Linebuf_getline(Linebuf * lb)
167 } 168 }
168 if (n != lb->size - 1) { 169 if (n != lb->size - 1) {
169 if (lb->errfun) 170 if (lb->errfun)
170 (*lb->errfun) ("%s: skipping incomplete last line\n", lb->filename); 171 (*lb->errfun) ("%s: skipping incomplete last line\n",
172 lb->filename);
171 return (NULL); 173 return (NULL);
172 } 174 }
173 /* Double the buffer if we need more space */ 175 /* Double the buffer if we need more space */
174 if (!(lb->buf = realloc(lb->buf, (lb->size *= 2)))) { 176 if (!(lb->buf = realloc(lb->buf, (lb->size *= 2)))) {
175 if (lb->errfun) 177 if (lb->errfun)
176 (*lb->errfun) ("linebuf (%s): realloc failed\n", lb->filename); 178 (*lb->errfun) ("linebuf (%s): realloc failed\n",
179 lb->filename);
177 return (NULL); 180 return (NULL);
178 } 181 }
179 } 182 }
@@ -184,6 +187,7 @@ fdlim_get(int hard)
184{ 187{
185#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) 188#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE)
186 struct rlimit rlfd; 189 struct rlimit rlfd;
190
187 if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0) 191 if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
188 return (-1); 192 return (-1);
189 if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY) 193 if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY)
@@ -222,7 +226,7 @@ fdlim_set(int lim)
222 * separators. This is the same as the 4.4BSD strsep, but different from the 226 * separators. This is the same as the 4.4BSD strsep, but different from the
223 * one in the GNU libc. 227 * one in the GNU libc.
224 */ 228 */
225inline char * 229static __inline__ char *
226xstrsep(char **str, const char *delim) 230xstrsep(char **str, const char *delim)
227{ 231{
228 char *s, *e; 232 char *s, *e;