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

Diff for /src/usr.bin/error/Attic/touch.c between version 1.6 and 1.7

version 1.6, 1998/07/10 14:09:56 version 1.7, 1999/12/04 00:09:22
Line 41 
Line 41 
 static char rcsid[] = "$OpenBSD$";  static char rcsid[] = "$OpenBSD$";
 #endif /* not lint */  #endif /* not lint */
   
 #include <sys/types.h>  #include <sys/param.h>
 #include <sys/stat.h>  #include <sys/stat.h>
 #include <signal.h>  #include <signal.h>
 #include <unistd.h>  #include <unistd.h>
Line 520 
Line 520 
 FILE    *o_touchedfile; /* the old file */  FILE    *o_touchedfile; /* the old file */
 FILE    *n_touchedfile; /* the new file */  FILE    *n_touchedfile; /* the new file */
 char    *o_name;  char    *o_name;
 char    n_name[64];  char    n_name[MAXPATHLEN];
 int     o_lineno;  int     o_lineno;
 int     n_lineno;  int     n_lineno;
 boolean tempfileopen = FALSE;  boolean tempfileopen = FALSE;
Line 538 
Line 538 
                 warn("Can't open file \"%s\" to touch (read)", name);                  warn("Can't open file \"%s\" to touch (read)", name);
                 return(TRUE);                  return(TRUE);
         }          }
         strcpy(n_name, _PATH_TMPFILE);          strlcpy(n_name, _PATH_TMPFILE, sizeof(n_name));
         if ((fd = mkstemp(n_name)) == -1 ||          if ((fd = mkstemp(n_name)) == -1 ||
             (n_touchedfile = fdopen(fd, "w")) == NULL) {              (n_touchedfile = fdopen(fd, "w")) == NULL) {
                 if (fd != -1)                  if (fd != -1)

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