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

Diff for /src/usr.bin/tip/Attic/uucplock.c between version 1.7 and 1.8

version 1.7, 2002/05/07 06:56:50 version 1.8, 2002/05/29 09:23:25
Line 62 
Line 62 
 uu_lock(ttyname)  uu_lock(ttyname)
         char *ttyname;          char *ttyname;
 {  {
         int fd, pid;          int fd, len;
         char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];          char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN];
         char text_pid[81];          char text_pid[81];
         int len;          pid_t pid;
   
         (void)snprintf(tbuf, sizeof tbuf, _PATH_LOCKDIRNAME, ttyname);          (void)snprintf(tbuf, sizeof tbuf, _PATH_LOCKDIRNAME, ttyname);
         fd = open(tbuf, O_RDWR|O_CREAT|O_EXCL, 0660);          fd = open(tbuf, O_RDWR|O_CREAT|O_EXCL, 0660);
Line 109 
Line 109 
                 /* fall out and finish the locking process */                  /* fall out and finish the locking process */
         }          }
         pid = getpid();          pid = getpid();
         (void)sprintf(text_pid, "%10d\n", pid);          (void)snprintf(text_pid, sizeof text_pid, "%10ld\n", (long)pid);
         len = strlen(text_pid);          len = strlen(text_pid);
         if (write(fd, text_pid, len) != len) {          if (write(fd, text_pid, len) != len) {
                 (void)close(fd);                  (void)close(fd);

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