* fhandler.h (enum query_state): Add query_write_attributes state.

(fhandler_base::status.query_open): Add a bit to make room for more
	states.
	(class fhandler_base): Declare new method utimes.
	(class fhandler_socket): Ditto.
	(class fhandler_disk_file): Ditto.
	(fhandler_disk_file::fhandler_disk_file): Add constructor with
	path_conv parameter.
	* fhandler.cc (fhandler_base::open): Add query_write_attributes
	handling.
	(fhandler_base::utimes): New method.
	* fhandler_disk_file.cc (fhandler_disk_file::link): Simplify.
	Open file with query_write_attributes instead of query_write_control.
	(fhandler_disk_file::utimes): New method.
	(fhandler_disk_file::fhandler_disk_file): Add constructor with
	path_conv parameter setting pc member immediately.
	* fhandler_socket.cc (fhandler_socket::fchmod): Use new
	fhandler_disk_file constructor.
	(fhandler_socket::fchown): Ditto.
	(fhandler_socket::facl): Ditto.
	(fhandler_socket::link): Ditto.
	(fhandler_socket::utimes): New method.
	* times.cc: Include dtable.h.
	(timeval_to_filetime): Make non-static.
	(utimes): Move functionality into fhandler method utimes. Just call
	this method from here.
	* winsup.h: Simplify declarations of time helper functions.
	(timeval_to_filetime): Add extern declaration.
This commit is contained in:
Corinna Vinschen
2005-02-20 11:44:32 +00:00
parent 731028b326
commit 2b09be25a3
7 changed files with 161 additions and 129 deletions

View File

@@ -583,6 +583,10 @@ fhandler_base::open (int flags, mode_t mode)
access = READ_CONTROL | WRITE_OWNER | WRITE_DAC | FILE_WRITE_ATTRIBUTES;
create_options = FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_FOR_RECOVERY;
break;
case query_write_attributes:
access = READ_CONTROL | FILE_WRITE_ATTRIBUTES;
create_options = FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_FOR_RECOVERY;
break;
default:
create_options = 0;
if (get_major () == DEV_TAPE_MAJOR && (flags & O_TEXT))
@@ -1612,3 +1616,10 @@ fhandler_base::link (const char *newpath)
set_errno (EINVAL);
return -1;
}
int
fhandler_base::utimes (const struct timeval *tvp)
{
set_errno (EINVAL);
return -1;
}