/[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.26 by polak, Sun Dec 29 12:52:07 2002 UTC revision 1.27 by gray, Wed Feb 5 22:23:28 2003 UTC
# Line 34  Line 34 
34    
35  #define BODY_MODIFIED 0x10000  #define BODY_MODIFIED 0x10000
36    
 static int lazy_create    __P ((body_t));  
37  static int _body_flush    __P ((stream_t));  static int _body_flush    __P ((stream_t));
38  static int _body_get_fd   __P ((stream_t, int *));  static int _body_get_fd   __P ((stream_t, int *));
39  static int _body_read     __P ((stream_t, char *, size_t, off_t, size_t *));  static int _body_read     __P ((stream_t, char *, size_t, off_t, size_t *));
# Line 147  body_get_stream (body_t body, stream_t * Line 146  body_get_stream (body_t body, stream_t *
146    
147    if (body->stream == NULL)    if (body->stream == NULL)
148      {      {
       int fd;  
149        int status = stream_create (&body->stream, MU_STREAM_RDWR, body);        int status = stream_create (&body->stream, MU_STREAM_RDWR, body);
150        if (status != 0)        if (status != 0)
151          return status;          return status;
152        /* Create the temporary file.  */        /* Create the temporary file.  */
153        fd = lazy_create (body);        body->filename = mu_tempname (NULL);
154        if (fd == -1)        status = file_stream_create (&body->fstream,
155          return errno;                                     body->filename, MU_STREAM_RDWR);
       status = file_stream_create (&body->fstream, body->filename, MU_STREAM_RDWR);  
156        if (status != 0)        if (status != 0)
157          return status;          return status;
158        status = stream_open (body->fstream);        status = stream_open (body->fstream);
       close (fd);  
159        if (status != 0)        if (status != 0)
160          return status;          return status;
161        stream_set_fd (body->stream, _body_get_fd, body);        stream_set_fd (body->stream, _body_get_fd, body);
# Line 340  _body_get_lines0 (stream_t stream, size_ Line 336  _body_get_lines0 (stream_t stream, size_
336    return status;    return status;
337  }  }
338    
 #ifndef P_tmpdir  
 #  define P_tmpdir "/tmp"  
 #endif  
   
339  static int  static int
340  lazy_create (body_t body)  lazy_create (body_t body)
341  {  {

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

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