[BACK]Return to fstab.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / gen

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libc/gen/fstab.c between version 1.1.1.2 and 1.8.2.1

version 1.1.1.2, 1995/02/25 09:11:33 version 1.8.2.1, 1996/09/19 20:02:35
Line 1 
Line 1 
   /*      $NetBSD$        */
   
 /*  /*
  * Copyright (c) 1980, 1988, 1993   * Copyright (c) 1980, 1988, 1993
  *      The Regents of the University of California.  All rights reserved.   *      The Regents of the University of California.  All rights reserved.
Line 32 
Line 34 
  */   */
   
 #if defined(LIBC_SCCS) && !defined(lint)  #if defined(LIBC_SCCS) && !defined(lint)
   #if 0
 static char sccsid[] = "@(#)fstab.c     8.1 (Berkeley) 6/4/93";  static char sccsid[] = "@(#)fstab.c     8.1 (Berkeley) 6/4/93";
   #else
   static char rcsid[] = "$NetBSD$";
   #endif
 #endif /* LIBC_SCCS and not lint */  #endif /* LIBC_SCCS and not lint */
   
   #include "namespace.h"
   #include <sys/types.h>
   #include <sys/uio.h>
 #include <errno.h>  #include <errno.h>
 #include <fstab.h>  #include <fstab.h>
 #include <stdio.h>  #include <stdio.h>
Line 42  static char sccsid[] = "@(#)fstab.c 8.1 
Line 51  static char sccsid[] = "@(#)fstab.c 8.1 
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   
   #ifdef __weak_alias
   __weak_alias(endfsent,_endfsent);
   __weak_alias(getfsent,_getfsent);
   __weak_alias(getfsfile,_getfsfile);
   __weak_alias(getfsspec,_getfsspec);
   __weak_alias(setfsent,_setfsent);
   #endif
   
 static FILE *_fs_fp;  static FILE *_fs_fp;
 static struct fstab _fs_fstab;  static struct fstab _fs_fstab;
   
 static error __P((int));  static void error __P((int));
 static fstabscan __P((void));  static int fstabscan __P((void));
   
 static  static int
 fstabscan()  fstabscan()
 {  {
         register char *cp;          register char *cp;
Line 63  fstabscan()
Line 80  fstabscan()
 /* OLD_STYLE_FSTAB */  /* OLD_STYLE_FSTAB */
                 if (!strpbrk(cp, " \t")) {                  if (!strpbrk(cp, " \t")) {
                         _fs_fstab.fs_spec = strtok(cp, ":\n");                          _fs_fstab.fs_spec = strtok(cp, ":\n");
                           if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec == '#')
                                   continue;
                         _fs_fstab.fs_file = strtok((char *)NULL, ":\n");                          _fs_fstab.fs_file = strtok((char *)NULL, ":\n");
                         _fs_fstab.fs_type = strtok((char *)NULL, ":\n");                          _fs_fstab.fs_type = strtok((char *)NULL, ":\n");
                         if (_fs_fstab.fs_type) {                          if (_fs_fstab.fs_type) {
Line 166  getfsfile(name)
Line 185  getfsfile(name)
         return((struct fstab *)NULL);          return((struct fstab *)NULL);
 }  }
   
   int
 setfsent()  setfsent()
 {  {
         if (_fs_fp) {          if (_fs_fp) {
Line 187  endfsent()
Line 207  endfsent()
         }          }
 }  }
   
 static  static void
 error(err)  error(err)
         int err;          int err;
 {  {
         char *p;          struct iovec iov[5];
   
         (void)write(STDERR_FILENO, "fstab: ", 7);          iov[0].iov_base = "fstab: ";
         (void)write(STDERR_FILENO, _PATH_FSTAB, sizeof(_PATH_FSTAB) - 1);          iov[0].iov_len = 7;
         (void)write(STDERR_FILENO, ": ", 1);          iov[1].iov_base = _PATH_FSTAB;
         p = strerror(err);          iov[1].iov_len = sizeof(_PATH_FSTAB) - 1;
         (void)write(STDERR_FILENO, p, strlen(p));          iov[2].iov_base =  ": ";
         (void)write(STDERR_FILENO, "\n", 1);          iov[2].iov_len = 2;
           iov[3].iov_base = strerror(err);
           iov[3].iov_len = strlen(iov[3].iov_base);
           iov[4].iov_base = "\n";
           iov[4].iov_len = 1;
           (void)writev(STDERR_FILENO, iov, 5);
 }  }

Legend:
Removed from v.1.1.1.2  
changed lines
  Added in v.1.8.2.1

CVSweb <webmaster@jp.NetBSD.org>