summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/getLock.c
diff options
context:
space:
mode:
authorsof <unknown>1999-03-01 09:11:39 +0000
committersof <unknown>1999-03-01 09:11:39 +0000
commitdd9e589f11b73b298c2f33bc2881faf80d75376b (patch)
tree0c4385df2456d5a1166fc7e78ee1d2453ad73521 /ghc/lib/std/cbits/getLock.c
parent0c82f29febee7ed9a10925d906e719f1b4e801e6 (diff)
downloadhaskell-dd9e589f11b73b298c2f33bc2881faf80d75376b.tar.gz
[project @ 1999-03-01 09:11:39 by sof]
mingw32: Turn off file locking. Of questionable value + impl is i-node based.
Diffstat (limited to 'ghc/lib/std/cbits/getLock.c')
-rw-r--r--ghc/lib/std/cbits/getLock.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/ghc/lib/std/cbits/getLock.c b/ghc/lib/std/cbits/getLock.c
index be6acb46f1..756457c957 100644
--- a/ghc/lib/std/cbits/getLock.c
+++ b/ghc/lib/std/cbits/getLock.c
@@ -1,7 +1,7 @@
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: getLock.c,v 1.4 1999/02/04 12:13:15 sof Exp $
+ * $Id: getLock.c,v 1.5 1999/03/01 09:11:39 sof Exp $
*
* stdin/stout/stderr Runtime Support
*/
@@ -65,8 +65,12 @@ int exclusive;
we don't have any read locks on it already.. */
for (i = 0; i < readLocks; i++) {
if (readLock[i].inode == sb.st_ino && readLock[i].device == sb.st_dev) {
+#ifndef __MINGW32__
errno = EAGAIN;
return -1;
+#else
+ break;
+#endif
}
}
/* If we're determined that there is only a single
@@ -76,8 +80,12 @@ int exclusive;
if (exclusive) {
for (i = 0; i < writeLocks; i++) {
if (writeLock[i].inode == sb.st_ino && writeLock[i].device == sb.st_dev) {
+#ifndef __MINGW32__
errno = EAGAIN;
return -1;
+#else
+ break;
+#endif
}
}
}
@@ -92,8 +100,12 @@ int exclusive;
that there's no-one writing to the underlying file. */
for (i = 0; i < writeLocks; i++) {
if (writeLock[i].inode == sb.st_ino && writeLock[i].device == sb.st_dev) {
- errno = EAGAIN;
- return -1;
+#ifndef __MINGW32__
+ errno = EAGAIN;
+ return -1;
+#else
+ break;
+#endif
}
}
/* Fit in new entry, reusing an existing table entry, if possible. */