diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-12-10 21:33:00 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-12-10 21:33:00 +0200 |
commit | 1ef742582942bb2a7ef4ce8531cf3b306b3f82d7 (patch) | |
tree | b8b97fcb906a3e0a82ed88653035a4d570a49cca /mh/mh_whatnow.c | |
parent | 841fc4842ae81579edab2a7752b0347944575d2c (diff) | |
download | mailutils-1ef742582942bb2a7ef4ce8531cf3b306b3f82d7.tar.gz mailutils-1ef742582942bb2a7ef4ce8531cf3b306b3f82d7.tar.bz2 |
Remove the MU_STREAM_FD_AUTOCLOSE stream flag.
This is the default behavior now. The reverse can be requested by
a special MU_IOCTL_FD,MU_IOCTL_FD_SET_BORROW ioctl.
* include/mailutils/stream.h (MU_STREAM_FD_AUTOCLOSE): Remove. This
is the default behavior now.
(MU_IOCTL_FD): New ioctl.
(MU_IOCTL_FD_GET_BORROW, MU_IOCTL_FD_SET_BORROW): New opcodes.
* include/mailutils/sys/file_stream.h (_MU_FILE_STREAM_FD_BORROWED): New flag.
* libmailutils/stream/file_stream.c (fd_close): Close the fd unless
_MU_FILE_STREAM_FD_BORROWED bit is set.
(fd_open): Clear the _MU_FILE_STREAM_FD_BORROWED bit.
(fd_ioctl): Handle MU_IOCTL_FD.
(mu_file_stream_create): Remove MU_STREAM_FD_AUTOCLOSE.
* ibmailutils/base/version.c (mu_print_options): Set borrow mode on the
temporary stdout stream.
* libmailutils/cfg/driver.c (mu_cfg_tree_reduce): Set borrow mode on the
temporary stderr stream.
* libmailutils/stdstream/strerr.c (mu_stdstream_strerr_create): Set borrow
mode on the stderr stream.
* libmailutils/tests/tempfile.c: set borrow mode on the temporary stream,
because it may be reopened later (verify mode).
* examples/mta.c: Remove MU_STREAM_FD_AUTOCLOSE.
* imap4d/io.c: Likewise.
* libmailutils/stream/prog_stream.c: Likewise.
* libmailutils/stream/socket_stream.c: Likewise.
* libmailutils/stream/temp_file_stream.c: Likewise.
* maidag/lmtp.c: Likewise.
* pop3d/extra.c: Likewise.
These will disappear when the corresponding utilities are rewritten to
use MU stdstream:
* mail/escape.c (quote0): set borrow mode on the output stream.
* mimeview/mimeview.c (display_file): set borrow mode on the input stream.
Likewise, these will disappear when MH uses MU stdstream:
* mh/anno.c (main): Set borrow mode on the input stream.
* mh/mh_init.c (mh_real_install): Likewise.
* mh/mh_whatnow.c (_whatnow): Likewise.
* mh/mhl.c (open_output): Set borrow mode on the output stream.
* mh/mhn.c (mhn_show,store_handler): Likewise.
Diffstat (limited to 'mh/mh_whatnow.c')
-rw-r--r-- | mh/mh_whatnow.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mh/mh_whatnow.c b/mh/mh_whatnow.c index dee46b5ac..39310dba1 100644 --- a/mh/mh_whatnow.c +++ b/mh/mh_whatnow.c @@ -336,6 +336,7 @@ _whatnow (struct mh_whatnow_env *wh, struct action_tab *tab) size_t size = 0; struct mu_wordsplit ws; int wsflags = MU_WRDSF_DEFFLAGS|MU_WRDSF_COMMENT; + int yes = 1; rc = mu_stdio_stream_create (&in, MU_STDIN_FD, 0); if (rc) @@ -343,7 +344,8 @@ _whatnow (struct mh_whatnow_env *wh, struct action_tab *tab) mu_error (_("cannot create input stream: %s"), mu_strerror (rc)); exit (1); } - + mu_stream_ioctl (in, MU_IOCTL_FD, MU_IOCTL_FD_SET_BORROW, &yes); + do { size_t n; |