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

Diff for /src/usr.bin/rsync/flist.c between version 1.27 and 1.28

version 1.27, 2019/06/02 14:29:58 version 1.28, 2019/06/23 10:28:32
Line 803 
Line 803 
     size_t *max)      size_t *max)
 {  {
         char            *cargv[2], *cp;          char            *cargv[2], *cp;
         int              rc = 0, nxdev = 0, flag, i;          int              rc = 0, flag;
         FTS             *fts;          FTS             *fts;
         FTSENT          *ent;          FTSENT          *ent;
         struct flist    *f;          struct flist    *f;
         size_t           flsz = 0, stripdir;          size_t           i, flsz = 0, nxdev = 0, stripdir;
         dev_t           *xdev;          dev_t           *newxdev, *xdev = NULL;
         struct stat      st;          struct stat      st;
   
         cargv[0] = root;          cargv[0] = root;
Line 931 
Line 931 
                             !S_ISDIR(ent->fts_statp->st_mode))                              !S_ISDIR(ent->fts_statp->st_mode))
                                 continue;                                  continue;
   
                         if ((xdev = malloc(sizeof(dev_t))) == NULL) {  
                                 ERRX1("malloc");  
                                 goto out;  
                         }  
   
                         flag = 0;                          flag = 0;
                         for (i = 0; i < nxdev; i++)                          for (i = 0; i < nxdev; i++)
                                 if (xdev[i] == ent->fts_statp->st_dev) {                                  if (xdev[i] == ent->fts_statp->st_dev) {
Line 945 
Line 940 
                         if (flag)                          if (flag)
                                 continue;                                  continue;
   
                         if (nxdev)                          if ((newxdev = reallocarray(xdev, nxdev + 1,
                                 if ((xdev = realloc(xdev, sizeof(dev_t))) ==                              sizeof(dev_t))) == NULL) {
                                     NULL) {                                  ERRX1("reallocarray");
                                         ERRX1("realloc");                                  goto out;
                                         goto out;                          }
                                 }                          xdev = newxdev;
                         xdev[nxdev] = ent->fts_statp->st_dev;                          xdev[nxdev] = ent->fts_statp->st_dev;
                         nxdev++;                          nxdev++;
                 }                  }
Line 1008 
Line 1003 
         rc = 1;          rc = 1;
 out:  out:
         fts_close(fts);          fts_close(fts);
         if (sess->opts->one_file_system)          free(xdev);
                 free(xdev);  
         return rc;          return rc;
 }  }
   

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28