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

Diff for /src/usr.bin/oldrdist/Attic/server.c between version 1.25 and 1.26

version 1.25, 2004/01/15 19:12:31 version 1.26, 2004/01/16 01:12:35
Line 212 
Line 212 
                         continue;                          continue;
   
                 case 'L':  /* Log. save message in log file */                  case 'L':  /* Log. save message in log file */
                         log(lfp, "%s", cp);                          logit(lfp, "%s", cp);
                         continue;                          continue;
 #endif  #endif
   
Line 388 
Line 388 
   
         if (pw == NULL || pw->pw_uid != stb.st_uid)          if (pw == NULL || pw->pw_uid != stb.st_uid)
                 if ((pw = getpwuid(stb.st_uid)) == NULL) {                  if ((pw = getpwuid(stb.st_uid)) == NULL) {
                         log(lfp, "%s: no password entry for uid %u \n",                          logit(lfp, "%s: no password entry for uid %u \n",
                                 target, stb.st_uid);                                  target, stb.st_uid);
                         pw = NULL;                          pw = NULL;
                         (void) snprintf(user, sizeof(user), ":%u", stb.st_uid);                          (void) snprintf(user, sizeof(user), ":%u", stb.st_uid);
                 }                  }
         if (gr == NULL || gr->gr_gid != stb.st_gid)          if (gr == NULL || gr->gr_gid != stb.st_gid)
                 if ((gr = getgrgid(stb.st_gid)) == NULL) {                  if ((gr = getgrgid(stb.st_gid)) == NULL) {
                         log(lfp, "%s: no name for group %u\n",                          logit(lfp, "%s: no name for group %u\n",
                                 target, stb.st_gid);                                  target, stb.st_gid);
                         gr = NULL;                          gr = NULL;
                         (void) snprintf(group, sizeof(group), ":%u",                          (void) snprintf(group, sizeof(group), ":%u",
Line 403 
Line 403 
                 }                  }
         if (u == 1) {          if (u == 1) {
                 if (opts & VERIFY) {                  if (opts & VERIFY) {
                         log(lfp, "need to install: %s\n", target);                          logit(lfp, "need to install: %s\n", target);
                         goto dospecial;                          goto dospecial;
                 }                  }
                 log(lfp, "installing: %s\n", target);                  logit(lfp, "installing: %s\n", target);
                 opts &= ~(COMPARE|REMOVE);                  opts &= ~(COMPARE|REMOVE);
         }          }
   
Line 491 
Line 491 
   
         if (u == 2) {          if (u == 2) {
                 if (opts & VERIFY) {                  if (opts & VERIFY) {
                         log(lfp, "need to update: %s\n", target);                          logit(lfp, "need to update: %s\n", target);
                         goto dospecial;                          goto dospecial;
                 }                  }
                 log(lfp, "updating: %s\n", target);                  logit(lfp, "updating: %s\n", target);
         }          }
   
         if (stb.st_nlink > 1) {          if (stb.st_nlink > 1) {
Line 545 
Line 545 
                         continue;                          continue;
                 if (sc->sc_args != NULL && !inlist(sc->sc_args, target))                  if (sc->sc_args != NULL && !inlist(sc->sc_args, target))
                         continue;                          continue;
                 log(lfp, "special \"%s\"\n", sc->sc_name);                  logit(lfp, "special \"%s\"\n", sc->sc_name);
                 if (opts & VERIFY)                  if (opts & VERIFY)
                         continue;                          continue;
                 (void) snprintf(buf, sizeof(buf), "SFILE=%s;%s\n", target,                  (void) snprintf(buf, sizeof(buf), "SFILE=%s;%s\n", target,
Line 571 
Line 571 
                 }                  }
         lp = (struct linkbuf *) malloc(sizeof(*lp));          lp = (struct linkbuf *) malloc(sizeof(*lp));
         if (lp == NULL)          if (lp == NULL)
                 log(lfp, "out of memory, link information lost\n");                  logit(lfp, "out of memory, link information lost\n");
         else {          else {
                 lp->nextp = ihead;                  lp->nextp = ihead;
                 ihead = lp;                  ihead = lp;
Line 642 
Line 642 
         case '\3':          case '\3':
                 *--cp = '\0';                  *--cp = '\0';
                 if (lfp != NULL)                  if (lfp != NULL)
                         log(lfp, "update: note: %s\n", s);                          logit(lfp, "update: note: %s\n", s);
                 goto again;                  goto again;
   
         default:          default:
Line 678 
Line 678 
                 if (stp->st_mtime == mtime)                  if (stp->st_mtime == mtime)
                         return(0);                          return(0);
                 if (stp->st_mtime < mtime) {                  if (stp->st_mtime < mtime) {
                         log(lfp, "Warning: %s: remote copy is newer\n", target);                          logit(lfp, "Warning: %s: remote copy is newer\n", target);
                         return(0);                          return(0);
                 }                  }
         } else if (stp->st_mtime == mtime && stp->st_size == size)          } else if (stp->st_mtime == mtime && stp->st_size == size)
Line 1184 
Line 1184 
                 case '\0':                  case '\0':
                         *--cp = '\0';                          *--cp = '\0';
                         if (*s != '\0')                          if (*s != '\0')
                                 log(lfp, "%s\n", s);                                  logit(lfp, "%s\n", s);
                         break;                          break;
   
                 case 'E':                  case 'E':
Line 1436 
Line 1436 
 }  }
   
 void  void
 log(FILE *fp, const char *fmt, ...)  logit(FILE *fp, const char *fmt, ...)
 {  {
         va_list ap;          va_list ap;
   
Line 1529 
Line 1529 
         case '\0':          case '\0':
                 *--cp = '\0';                  *--cp = '\0';
                 if (*s != '\0') {                  if (*s != '\0') {
                         log(lfp, "%s\n", s);                          logit(lfp, "%s\n", s);
                         return(1);                          return(1);
                 }                  }
                 return(0);                  return(0);
         case '\3':          case '\3':
                 *--cp = '\0';                  *--cp = '\0';
                 log(lfp, "Note: %s\n",s);                  logit(lfp, "Note: %s\n",s);
                 return(response());                  return(response());
   
         default:          default:

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26