Throughout, call fcntl64 instead of fcntl or fcntl_worker.

* fcntl.cc (fcntl_worker): Remove.
	(fcntl64): Add fault handler.  Move fcntl_worker stuff here.  Add case
	for locking and call fhandler's lock method directly.  Make sure that
	F_FLOCK flag isn't set in lock call.
	(_fcntl): Add fault handler.
	* fhandler.cc (fhandler_base::fcntl): Drop lock cases.
	* flock.cc (flock): Add fault handler.  Simplify code.  Call fhandlers
	lock method directly instead of fcntl_worker.  Add debug output.
	(lockf): Add fault handler.  Call fhandlers lock method directly
	instead of fcntl_worker.  Add debug output.
	* winsup.h (fcntl_worker): Drop declaration.
	(fcntl64): Declare.
This commit is contained in:
Corinna Vinschen
2008-04-01 10:22:33 +00:00
parent 636c94d853
commit fabfb1a1ee
10 changed files with 109 additions and 95 deletions

View File

@ -427,7 +427,7 @@ int res_nsend( res_state statp, const unsigned char * MsgPtr,
return -1;
}
/* Set close on exec flag */
if (fcntl(statp->sockfd, F_SETFD, 1) == -1) {
if (fcntl64(statp->sockfd, F_SETFD, 1) == -1) {
DPRINTF(debug, "fcntl: %s\n",
strerror(errno));
statp->res_h_errno = NETDB_INTERNAL;

View File

@ -203,7 +203,7 @@ cygwin_rcmd_af(char **ahost, in_port_t rport, const char *locuser,
NULL);
return (-1);
}
fcntl(s, F_SETOWN, pid);
fcntl64(s, F_SETOWN, pid);
if (cygwin_connect(s, ai->ai_addr, ai->ai_addrlen) >= 0)
break;
(void)close(s);