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

Diff for /src/usr.bin/file/Attic/compress.c between version 1.14 and 1.15

version 1.14, 2009/10/27 23:59:37 version 1.15, 2011/01/10 20:59:42
Line 235 
Line 235 
         int r, tfd;          int r, tfd;
   
         (void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf);          (void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf);
 #ifndef HAVE_MKSTEMP  
         {  
                 char *ptr = mktemp(buf);  
                 tfd = open(ptr, O_RDWR|O_TRUNC|O_EXCL|O_CREAT, 0600);  
                 r = errno;  
                 (void)unlink(ptr);  
                 errno = r;  
         }  
 #else  
         tfd = mkstemp(buf);          tfd = mkstemp(buf);
         r = errno;          r = errno;
         (void)unlink(buf);          (void)unlink(buf);
         errno = r;          errno = r;
 #endif  
         if (tfd == -1) {          if (tfd == -1) {
                 file_error(ms, errno,                  file_error(ms, errno,
                     "cannot create temporary file for pipe copy");                      "cannot create temporary file for pipe copy");

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15