From 56551a9bfbb369e29b12d1b60dc810cd5a3356b9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 10 Apr 2004 13:45:10 +0000 Subject: * Use new unified status_flag accessor methods from classes fhandler_*, tty_min, mtinfo and fs_info thoroughout. * fhandler.h: Redefine all set_close_on_exec methods to take a bool argument. (enum conn_state): Rename from connect_state. (class fhandler_base): Rename some status flags to align with accessor method names. Drop encoded flag entirely. Unify status accessor methods. Const'ify all read accessor methods. (class fhandler_socket): Ditto. (class fhandler_dev_raw): Ditto. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use fs.fs_is_fat() instead of evaluating FATness of file system here. (fhandler_disk_file::opendir): Drop call to set_encoded(). (fhandler_disk_file::readdir): Use pc.isencoded() directly. * mtinfo.h (class mtinfo_drive): Const'ify all read accessor methods. * path.cc (fsinfo_cnt): Add. (fs_info::update): Accomodate class changes. Evaluate file system name specific flags right here. Add thread safety for reading and writing global fsinfo array. * path.h (enum path_types): Drop values for flags kept in fs already. (struct fs_info): Move status informatin into private struct type status_flags. Add accessor methods. Remove path and file system name string arrays in favor of status bits. (class path_conv): Use new fs_info status information where appropriate. (path_conf::fs_has_ea): Rename from fs_fast_ea. (path_conf::fs_has_acls): New method. (path_conf::root_dir): Remove. (path_conf::volname): Remove. * syscalls (statfs): Evaluate root dir locally. * tty.h (class tty_min): Unify status accessor methods. Const'ify all read accessor methods. --- winsup/cygwin/syscalls.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'winsup/cygwin/syscalls.cc') diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 006f371a8..ad99d8ab0 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -424,7 +424,7 @@ readv (int fd, const struct iovec *const iov, const int iovcnt) syscall_printf ("readv (%d, %p, %d) %sblocking, sigcatchers %d", fd, iov, iovcnt, wait ? "" : "non", sigcatchers); - if (wait && (!cfd->is_slow () || cfd->get_r_no_interrupt ())) + if (wait && (!cfd->is_slow () || cfd->uninterruptible_io ())) debug_printf ("no need to call ready_for_read"); else if (!cfd->ready_for_read (fd, wait)) { @@ -1617,7 +1617,7 @@ _cygwin_istext_for_stdio (int fd) } #endif - if (cfd->get_w_binary () || cfd->get_r_binary ()) + if (cfd->wbinary () || cfd->rbinary ()) { syscall_printf ("fd %d: opened as binary", fd); return 0; @@ -1681,9 +1681,9 @@ setmode (int fd, int mode) interfaces should not use setmode. */ int res; - if (cfd->get_w_binary () && cfd->get_r_binary ()) + if (cfd->wbinary () && cfd->rbinary ()) res = O_BINARY; - else if (cfd->get_w_binset () && cfd->get_r_binset ()) + else if (cfd->wbinset () && cfd->rbinset ()) res = O_TEXT; /* Specifically set O_TEXT */ else res = 0; @@ -1793,6 +1793,8 @@ get_osfhandle (int fd) extern "C" int statfs (const char *fname, struct statfs *sfs) { + char root_dir[CYG_MAX_PATH]; + if (!sfs) { set_errno (EFAULT); @@ -1800,7 +1802,8 @@ statfs (const char *fname, struct statfs *sfs) } path_conv full_path (fname, PC_SYM_FOLLOW | PC_FULL); - const char *root = full_path.root_dir (); + strncpy (root_dir, full_path, CYG_MAX_PATH); + const char *root = rootdir (root_dir); syscall_printf ("statfs %s", root); -- cgit v1.2.3