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

Diff for /src/usr.bin/rdist/client.c between version 1.7 and 1.8

version 1.7, 1998/06/26 21:21:00 version 1.8, 1999/02/04 23:18:57
Line 216 
Line 216 
   
         if (isokay) {          if (isokay) {
                 new = (struct namelist *) xmalloc(sizeof(struct namelist));                  new = (struct namelist *) xmalloc(sizeof(struct namelist));
                 new->n_name = strdup(rfile);                  new->n_name = xstrdup(rfile);
                 new->n_next = updfilelist;                  new->n_next = updfilelist;
                 updfilelist = new;                  updfilelist = new;
         }          }
Line 307 
Line 307 
         return(0);          return(0);
 }  }
   
   void freelinkinfo(lp)
           struct linkbuf *lp;
   {
           if (lp->pathname)
                   free(lp->pathname);
           if (lp->src)
                   free(lp->src);
           if (lp->target)
                   free(lp->target);
           free(lp);
   }
   
 /*  /*
  * Save and retrieve hard link info   * Save and retrieve hard link info
  */   */
Line 315 
Line 327 
 {  {
         struct linkbuf *lp;          struct linkbuf *lp;
   
           /* XXX - linear search doesn't scale with many links */
         for (lp = ihead; lp != NULL; lp = lp->nextp)          for (lp = ihead; lp != NULL; lp = lp->nextp)
                 if (lp->inum == statp->st_ino && lp->devnum == statp->st_dev) {                  if (lp->inum == statp->st_ino && lp->devnum == statp->st_dev) {
                         lp->count--;                          lp->count--;
Line 327 
Line 340 
         lp->inum = statp->st_ino;          lp->inum = statp->st_ino;
         lp->devnum = statp->st_dev;          lp->devnum = statp->st_dev;
         lp->count = statp->st_nlink - 1;          lp->count = statp->st_nlink - 1;
         (void) strcpy(lp->pathname, target);          lp->pathname = xstrdup(target);
         (void) strcpy(lp->src, source);          lp->src = xstrdup(source);
         if (Tdest)          if (Tdest)
                 (void) strcpy(lp->target, Tdest);                  lp->target = xstrdup(Tdest);
         else          else
                 *lp->target = CNULL;                  lp->target = NULL;
           if (!lp->pathname || !lp->src || !(Tdest && lp->target))
                   fatalerr("Cannot malloc memory in linkinfo.");
   
         return(NULL);          return(NULL);
 }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8