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.
Showing
22 changed files
with
94 additions
and
25 deletions
-
Please register or sign in to post a comment