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

Diff for /src/usr.bin/oldrdist/Attic/docmd.c between version 1.1 and 1.2

version 1.1, 1996/02/03 12:11:55 version 1.2, 1996/06/26 03:42:13
Line 139 
Line 139 
         if (nflag)          if (nflag)
                 printf("updating host %s\n", rhost);                  printf("updating host %s\n", rhost);
         else {          else {
                   int fd;
   
                 if (setjmp(env))                  if (setjmp(env))
                         goto done;                          goto done;
                 signal(SIGPIPE, lostconn);                  signal(SIGPIPE, lostconn);
                 if (!makeconn(rhost))                  if (!makeconn(rhost))
                         return;                          return;
                 if ((lfp = fopen(tempfile, "w")) == NULL) {                  if ((fd = open(tempfile, O_RDWR|O_EXCL|O_CREAT, 0666)) == -1 ||
                       (lfp = fdopen(fd, "w")) == NULL) {
                           if (fd != -1)
                                   close(fd);
                         fatal("cannot open %s\n", tempfile);                          fatal("cannot open %s\n", tempfile);
                         exit(1);                          exit(1);
                 }                  }
Line 367 
Line 372 
         if (nflag || (options & VERIFY))          if (nflag || (options & VERIFY))
                 tfp = NULL;                  tfp = NULL;
         else {          else {
                 if ((tfp = fopen(tempfile, "w")) == NULL) {                  int fd;
   
                   if ((fd = open(tempfile, O_RDWR|O_EXCL|O_CREAT, 0666)) == -1 ||
                       (tfp = fdopen(fd, "w")) == NULL) {
                           if (fd != -1)
                                   close(fd);
                         error("%s: %s\n", stamp, strerror(errno));                          error("%s: %s\n", stamp, strerror(errno));
                         return;                          return;
                 }                  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2