diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-02-21 07:37:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-02-21 07:37:05 +0000 |
commit | f24f93760fc051cbd8661bd36c090839275e99db (patch) | |
tree | 65d50e583888b1688d429c24633ba53b3097600b | |
parent | 70225e14c34f741ad9929c86c5a499c54fdc4a77 (diff) |
inline -> __inline__, and some indent
-rw-r--r-- | usr.bin/ssh/ssh-keyscan.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c index 8c6316a7fc2..e62a7a62c18 100644 --- a/usr.bin/ssh/ssh-keyscan.c +++ b/usr.bin/ssh/ssh-keyscan.c @@ -8,7 +8,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.16 2001/02/12 22:56:10 deraadt Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.17 2001/02/21 07:37:04 deraadt Exp $"); #include <sys/queue.h> #include <errno.h> @@ -81,7 +81,7 @@ typedef struct { void (*errfun) (const char *,...); } Linebuf; -static inline Linebuf * +static __inline__ Linebuf * Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) { Linebuf *lb; @@ -115,7 +115,7 @@ Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) return (lb); } -static inline void +static __inline__ void Linebuf_free(Linebuf * lb) { fclose(lb->stream); @@ -123,7 +123,7 @@ Linebuf_free(Linebuf * lb) xfree(lb); } -static inline void +static __inline__ void Linebuf_restart(Linebuf * lb) { clearerr(lb->stream); @@ -131,13 +131,13 @@ Linebuf_restart(Linebuf * lb) lb->lineno = 0; } -static inline int +static __inline__ int Linebuf_lineno(Linebuf * lb) { return (lb->lineno); } -static inline char * +static __inline__ char * Linebuf_getline(Linebuf * lb) { int n = 0; @@ -147,7 +147,8 @@ Linebuf_getline(Linebuf * lb) /* Read a line */ if (!fgets(&lb->buf[n], lb->size - n, lb->stream)) { if (ferror(lb->stream) && lb->errfun) - (*lb->errfun) ("%s: %s\n", lb->filename, strerror(errno)); + (*lb->errfun) ("%s: %s\n", lb->filename, + strerror(errno)); return (NULL); } n = strlen(lb->buf); @@ -159,13 +160,15 @@ Linebuf_getline(Linebuf * lb) } if (n != lb->size - 1) { if (lb->errfun) - (*lb->errfun) ("%s: skipping incomplete last line\n", lb->filename); + (*lb->errfun) ("%s: skipping incomplete last line\n", + lb->filename); return (NULL); } /* Double the buffer if we need more space */ if (!(lb->buf = realloc(lb->buf, (lb->size *= 2)))) { if (lb->errfun) - (*lb->errfun) ("linebuf (%s): realloc failed\n", lb->filename); + (*lb->errfun) ("linebuf (%s): realloc failed\n", + lb->filename); return (NULL); } } @@ -175,6 +178,7 @@ static int fdlim_get(int hard) { struct rlimit rlfd; + if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0) return (-1); if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY) @@ -202,7 +206,7 @@ fdlim_set(int lim) * separators. This is the same as the 4.4BSD strsep, but different from the * one in the GNU libc. */ -inline char * +static __inline__ char * xstrsep(char **str, const char *delim) { char *s, *e; |