[BACK]Return to filesys.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rdistd

Diff for /src/usr.bin/rdistd/filesys.c between version 1.18 and 1.19

version 1.18, 2015/01/20 09:00:16 version 1.19, 2015/01/21 04:08:37
Line 108 
Line 108 
                          * Normally we want to change /dir1/dir2/file                           * Normally we want to change /dir1/dir2/file
                          * into "/dir1/dir2/."                           * into "/dir1/dir2/."
                          */                           */
                         if ((p = (char *) strrchr(file, '/')) != NULL) {                          if ((p = strrchr(file, '/')) != NULL) {
                                 if (strcmp(p, "/.") == 0) {                                  if (strcmp(p, "/.") == 0) {
                                         *p = CNULL;                                          *p = CNULL;
                                 } else {                                  } else {
Line 131 
Line 131 
         }          }
   
         if (statbuf)          if (statbuf)
                 bcopy((char *) &filestat, (char *) statbuf, sizeof(filestat));                  bcopy(&filestat, statbuf, sizeof(filestat));
   
         /*          /*
          * Trim the "/." that we added.           * Trim the "/." that we added.
Line 147 
Line 147 
          * name in case the symlink points to another filesystem.           * name in case the symlink points to another filesystem.
          */           */
         if (S_ISLNK(filestat.st_mode))          if (S_ISLNK(filestat.st_mode))
                 if ((p = (char *) strrchr(file, '/')) && *p+1) {                  if ((p = strrchr(file, '/')) && *p+1) {
                         /* Is this / (root)? */                          /* Is this / (root)? */
                         if (p == file)                          if (p == file)
                                 file[1] = CNULL;                                  file[1] = CNULL;
Line 161 
Line 161 
         return(*file ? file : NULL);          return(*file ? file : NULL);
 }  }
   
 #if defined(NFS_CHECK) || defined(RO_CHECK)  
   
 /*  /*
  * Find the device that "filest" is on in the "mntinfo" linked list.   * Find the device that "filest" is on in the "mntinfo" linked list.
Line 174 
Line 173 
         for (mi = mntinfo; mi; mi = mi->mi_nxt) {          for (mi = mntinfo; mi; mi = mi->mi_nxt) {
                 if (mi->mi_mnt->me_flags & MEFLAG_IGNORE)                  if (mi->mi_mnt->me_flags & MEFLAG_IGNORE)
                         continue;                          continue;
                 if (filest->st_dev == mi->mi_statb->st_dev)                  if (filest->st_dev == mi->mi_dev)
                         return(mi->mi_mnt);                          return(mi->mi_mnt);
         }          }
   
Line 253 
Line 252 
                 /*                  /*
                  * Create new entry                   * Create new entry
                  */                   */
                 newmi = (struct mntinfo *) xcalloc(1, sizeof(struct mntinfo));                  newmi = xcalloc(1, sizeof(*newmi));
                 newmi->mi_mnt = newmountent(mnt);                  newmi->mi_mnt = newmountent(mnt);
                 newmi->mi_statb =                  newmi->mi_dev = mntstat.st_dev;
                     (struct stat *) xcalloc(1, sizeof(struct stat));  
                 bcopy((char *) &mntstat, (char *) newmi->mi_statb,  
                       sizeof(struct stat));  
   
                 /*                  /*
                  * Add entry to list                   * Add entry to list
Line 330 
Line 326 
         return(NULL);          return(NULL);
 }  }
   
 #endif /* NFS_CHECK || RO_CHECK */  
   
 #if     defined(NFS_CHECK)  
 /*  /*
  * Is "path" NFS mounted?  Return 1 if it is, 0 if not, or -1 on error.   * Is "path" NFS mounted?  Return 1 if it is, 0 if not, or -1 on error.
  */   */
Line 349 
Line 343 
   
         return(0);          return(0);
 }  }
 #endif  /* NFS_CHECK */  
   
 #if     defined(RO_CHECK)  
 /*  /*
  * Is "path" on a read-only mounted filesystem?   * Is "path" on a read-only mounted filesystem?
  * Return 1 if it is, 0 if not, or -1 on error.   * Return 1 if it is, 0 if not, or -1 on error.
Line 361 
Line 353 
 {  {
         mntent_t *mnt;          mntent_t *mnt;
   
         if ((mnt = (mntent_t *) getmntpt(path, statbuf, isvalid)) == NULL)          if ((mnt = getmntpt(path, statbuf, isvalid)) == NULL)
                 return(-1);                  return(-1);
   
         if (mnt->me_flags & MEFLAG_READONLY)          if (mnt->me_flags & MEFLAG_READONLY)
Line 369 
Line 361 
   
         return(0);          return(0);
 }  }
 #endif  /* RO_CHECK */  
   
 /*  /*
  * Is "path" a symlink?   * Is "path" a symlink?

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19