This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #1506
- Loading branch information
Showing
20 changed files
with
1,958 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,8 +180,8 @@ static void eio_destroy (eio_req *req); | |
static int | ||
symlink (const char *old, const char *neu) | ||
{ | ||
#if 0 && WINVER >= 0x0600 | ||
if (CreateSymbolicLink (neu, old, SYMBOLIC_LINK_FLAG_DIRECTORY)) | ||
#if WINVER >= 0x0600 | ||
if (CreateSymbolicLink (neu, old, 1)) | ||
return 0; | ||
|
||
if (CreateSymbolicLink (neu, old, 0)) | ||
|
@@ -401,6 +401,16 @@ static xmutex_t reslock; | |
static xmutex_t reqlock; | ||
static xcond_t reqwait; | ||
|
||
/* Fix for test-fs-sir-writes-alot */ | ||
/* Apple's OSX can't safely write() concurrently from 2 threads */ | ||
/* for more info see the thread "fs.write Data Munging" in the nodejs google group */ | ||
/* http://groups.google.com/group/nodejs/browse_thread/thread/c11f8b683f37cef/b18ad9e0a15314c5 */ | ||
/* And the thread "write()s and pwrite()s from multiple threads in OSX" in [email protected] */ | ||
/* http://lists.schmorp.de/pipermail/libev/2010q4/001185.html */ | ||
#if defined (__APPLE__) | ||
static xmutex_t apple_bug_writelock = X_MUTEX_INIT; | ||
#endif | ||
|
||
#if !HAVE_PREADWRITE | ||
/* | ||
* make our pread/pwrite emulation safe against themselves, but not against | ||
|
@@ -2153,9 +2163,20 @@ eio_execute (etp_worker *self, eio_req *req) | |
req->result = req->offs >= 0 | ||
? pread (req->int1, req->ptr2, req->size, req->offs) | ||
: read (req->int1, req->ptr2, req->size); break; | ||
case EIO_WRITE: req->result = req->offs >= 0 | ||
|
||
case EIO_WRITE: | ||
#if defined (__APPLE__) | ||
pthread_mutex_lock (&apple_bug_writelock); | ||
#endif | ||
|
||
req->result = req->offs >= 0 | ||
? pwrite (req->int1, req->ptr2, req->size, req->offs) | ||
: write (req->int1, req->ptr2, req->size); break; | ||
: write (req->int1, req->ptr2, req->size); | ||
|
||
#if defined (__APPLE__) | ||
pthread_mutex_unlock (&apple_bug_writelock); | ||
#endif | ||
break; | ||
|
||
case EIO_READAHEAD: req->result = readahead (req->int1, req->offs, req->size); break; | ||
case EIO_SENDFILE: req->result = eio__sendfile (req->int1, req->int2, req->offs, req->size); break; | ||
|
Oops, something went wrong.