diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-11-25 17:12:32 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-11-25 19:39:53 +0200 |
commit | 8acde412feee7235b342196182c69d0ed25fe1fc (patch) | |
tree | d03411665f570504b028be70d1c48c01a61e6237 /guimb/collect.c | |
parent | 80bb8b2fc30ba04dda9eb652519c65897542437e (diff) | |
download | mailutils-8acde412feee7235b342196182c69d0ed25fe1fc.tar.gz mailutils-8acde412feee7235b342196182c69d0ed25fe1fc.tar.bz2 |
Rewrite temporary file handling.
* include/mailutils/util.h (mu_make_file_name_suf): New proto.
(mu_make_file_name): Replace with a macro.
(MU_TEMPFILE_TMPDIR,MU_TEMPFILE_SUFFIX)
(MU_TEMPFILE_MKDIR): New flags.
(mu_tempfile_hints): New struct.
(mu_tempfile): Change signature.
* libmailutils/base/tempfile.c (mu_create_temp_file): New function.
(mu_tempfile): Rewrite from scratch. Change signature. All callers
changed.
* libmailutils/string/mkfilename.c (mu_make_file_name): Remove.
(mu_make_file_name_suf): New function.
* libmailutils/stream/streamcpy.c (mu_stream_copy): Don't return EIO
on EOF.
* libmailutils/stream/file_stream.c (mu_fd_stream_create): If
MU_STREAM_SEEK is set, position fd to 0.
* guimb/collect.c: Update calls to mu_tempfile.
* lib/mailcap.c: Likewise.
* libmailutils/base/amd.c (_amd_tempfile): Rewrite using mu_tempfile.
* libmailutils/tests/tempfile.c: New file.
* libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add tempfile.
Diffstat (limited to 'guimb/collect.c')
-rw-r--r-- | guimb/collect.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/guimb/collect.c b/guimb/collect.c index 342e59370..853009542 100644 --- a/guimb/collect.c +++ b/guimb/collect.c @@ -55,8 +55,7 @@ collect_open_mailbox_file () int fd; /* Create input mailbox */ - fd = mu_tempfile (NULL, &temp_filename); - if (fd == -1) + if (mu_tempfile (NULL, 0, &fd, &temp_filename)) exit (1); temp_file = fdopen (fd, "w"); |