[BACK]Return to ssh-keyscan.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/ssh-keyscan.c between version 1.16 and 1.17

version 1.16, 2001/02/12 22:56:10 version 1.17, 2001/02/21 07:37:04
Line 81 
Line 81 
         void (*errfun) (const char *,...);          void (*errfun) (const char *,...);
 } Linebuf;  } Linebuf;
   
 static inline Linebuf *  static __inline__ Linebuf *
 Linebuf_alloc(const char *filename, void (*errfun) (const char *,...))  Linebuf_alloc(const char *filename, void (*errfun) (const char *,...))
 {  {
         Linebuf *lb;          Linebuf *lb;
Line 115 
Line 115 
         return (lb);          return (lb);
 }  }
   
 static inline void  static __inline__ void
 Linebuf_free(Linebuf * lb)  Linebuf_free(Linebuf * lb)
 {  {
         fclose(lb->stream);          fclose(lb->stream);
Line 123 
Line 123 
         xfree(lb);          xfree(lb);
 }  }
   
 static inline void  static __inline__ void
 Linebuf_restart(Linebuf * lb)  Linebuf_restart(Linebuf * lb)
 {  {
         clearerr(lb->stream);          clearerr(lb->stream);
Line 131 
Line 131 
         lb->lineno = 0;          lb->lineno = 0;
 }  }
   
 static inline int  static __inline__ int
 Linebuf_lineno(Linebuf * lb)  Linebuf_lineno(Linebuf * lb)
 {  {
         return (lb->lineno);          return (lb->lineno);
 }  }
   
 static inline char *  static __inline__ char *
 Linebuf_getline(Linebuf * lb)  Linebuf_getline(Linebuf * lb)
 {  {
         int n = 0;          int n = 0;
Line 147 
Line 147 
                 /* Read a line */                  /* Read a line */
                 if (!fgets(&lb->buf[n], lb->size - n, lb->stream)) {                  if (!fgets(&lb->buf[n], lb->size - n, lb->stream)) {
                         if (ferror(lb->stream) && lb->errfun)                          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);                          return (NULL);
                 }                  }
                 n = strlen(lb->buf);                  n = strlen(lb->buf);
Line 159 
Line 160 
                 }                  }
                 if (n != lb->size - 1) {                  if (n != lb->size - 1) {
                         if (lb->errfun)                          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);                          return (NULL);
                 }                  }
                 /* Double the buffer if we need more space */                  /* Double the buffer if we need more space */
                 if (!(lb->buf = realloc(lb->buf, (lb->size *= 2)))) {                  if (!(lb->buf = realloc(lb->buf, (lb->size *= 2)))) {
                         if (lb->errfun)                          if (lb->errfun)
                                 (*lb->errfun) ("linebuf (%s): realloc failed\n", lb->filename);                                  (*lb->errfun) ("linebuf (%s): realloc failed\n",
                                       lb->filename);
                         return (NULL);                          return (NULL);
                 }                  }
         }          }
Line 175 
Line 178 
 fdlim_get(int hard)  fdlim_get(int hard)
 {  {
         struct rlimit rlfd;          struct rlimit rlfd;
   
         if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)          if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
                 return (-1);                  return (-1);
         if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY)          if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY)
Line 202 
Line 206 
  * separators.  This is the same as the 4.4BSD strsep, but different from the   * separators.  This is the same as the 4.4BSD strsep, but different from the
  * one in the GNU libc.   * one in the GNU libc.
  */   */
 inline char *  static __inline__ char *
 xstrsep(char **str, const char *delim)  xstrsep(char **str, const char *delim)
 {  {
         char *s, *e;          char *s, *e;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17