From 0d75ce965cf46a16585477469bb4edb597a35f00 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 19 Feb 2005 21:53:36 +0000 Subject: * fhandler.h (class fhandler_base): Declare new method link. (class fhandler_socket): Ditto. (class fhandler_disk_file): Ditto. * fhandler.cc (fhandler_base::open): Add FILE_WRITE_ATTRIBUTES to query_write_control access flags. (fhandler_base::link): New method. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't try to open with O_WRONLY since query_write_control includes FILE_WRITE_ATTRIBUTES. (fhandler_disk_file::fchown): Ditto. (fhandler_disk_file::facl): Ditto. (fhandler_disk_file::link): New method. Touch st_ctime on successful link. * fhandler_socket.cc (fhandler_socket::link): New method. * syscalls.cc (link): Move functionality into fhandler method link. Just call this method from here. --- winsup/cygwin/fhandler.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 3fd0bc74b..f846d044e 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -580,7 +580,7 @@ fhandler_base::open (int flags, mode_t mode) create_options = FILE_OPEN_FOR_BACKUP_INTENT; break; case query_write_control: - access = READ_CONTROL | WRITE_OWNER | WRITE_DAC; + access = READ_CONTROL | WRITE_OWNER | WRITE_DAC | FILE_WRITE_ATTRIBUTES; create_options = FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_FOR_RECOVERY; break; default: @@ -1605,3 +1605,10 @@ fhandler_base::ftruncate (_off64_t length) set_errno (EINVAL); return -1; } + +int +fhandler_base::link (const char *newpath) +{ + set_errno (EINVAL); + return -1; +} -- cgit v1.2.3