/[mailutils]/mailutils/mailbox/body.c
ViewVC logotype

Diff of /mailutils/mailbox/body.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by alainm, Sun Dec 16 15:26:55 2001 UTC revision 1.25 by gray, Thu Jan 17 22:30:55 2002 UTC
# Line 29  Line 29 
29  #include <fcntl.h>  #include <fcntl.h>
30    
31  #include <mailutils/stream.h>  #include <mailutils/stream.h>
32    #include <mailutils/mutil.h>
33  #include <body0.h>  #include <body0.h>
34    
35  #define BODY_MODIFIED 0x10000  #define BODY_MODIFIED 0x10000
# Line 346  _body_get_lines0 (stream_t stream, size_ Line 347  _body_get_lines0 (stream_t stream, size_
347  static int  static int
348  lazy_create (body_t body)  lazy_create (body_t body)
349  {  {
350    const char *tmpdir = getenv ("TMPDIR");    return mu_tempfile (NULL, &body->filename);
   int fd;  
   if (tmpdir == NULL)  
     tmpdir = P_tmpdir;  
   body->filename = calloc (strlen (tmpdir) + 1 + /* "muXXXXXX" */ 8 + 1,  
                            sizeof (char));  
   if (body->filename == NULL)  
     return ENOMEM;  
   sprintf (body->filename, "%s/muXXXXXX", tmpdir);  
 #ifdef HAVE_MKSTEMP  
   fd = mkstemp (body->filename);  
 #else  
   if (mktemp (body->filename))  
     fd = open (body->filename, O_RDWR|O_CREAT|O_EXCL, 0600);  
   else  
     fd = -1;  
 #endif  
   return fd;  
351  }  }

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

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26