summaryrefslogtreecommitdiff
path: root/libmailutils/base
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-12-10 21:33:00 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2010-12-10 21:33:00 +0200
commit1ef742582942bb2a7ef4ce8531cf3b306b3f82d7 (patch)
treeb8b97fcb906a3e0a82ed88653035a4d570a49cca /libmailutils/base
parent841fc4842ae81579edab2a7752b0347944575d2c (diff)
downloadmailutils-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 'libmailutils/base')
-rw-r--r--libmailutils/base/version.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmailutils/base/version.c b/libmailutils/base/version.c
index 237377293..b5f6cd19a 100644
--- a/libmailutils/base/version.c
+++ b/libmailutils/base/version.c
@@ -150,6 +150,7 @@ mu_print_options ()
mu_stream_ref (mu_strout);
else
{
+ int yes = 1;
int rc = mu_stdio_stream_create (&mu_strout, MU_STDOUT_FD, 0);
if (rc)
{
@@ -157,6 +158,7 @@ mu_print_options ()
MU_STDOUT_FD, mu_strerror (rc));
abort ();
}
+ mu_stream_ioctl (mu_strout, MU_IOCTL_FD, MU_IOCTL_FD_SET_BORROW, &yes);
}
mu_format_options (mu_strout, 1);
mu_stream_unref (mu_strout);

Return to:

Send suggestions and report system problems to the System administrator.