Mail Archives: djgpp-workers/2000/08/16/06:17:12
Here is the change for readlink() based on Eli's
comments and open() code.
Any comments?
Laurynas
Index: readlink.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/compat/unistd/readlink.c,v
retrieving revision 1.1
diff -u -r1.1 readlink.c
--- readlink.c 2000/08/11 11:16:24 1.1
+++ readlink.c 2000/08/16 10:15:43
@@ -45,7 +45,17 @@
/* Now we check for special DJGPP symlink format */
fd = _open(filename, O_RDONLY);
if (fd < 0)
- return -1; /* errno from open() call */
+ {
+ /* Retry with DENY-NONE share bit set. It might help in some cases
+ * when symlink file is opened by another program. We don't try with
+ * DENY-NONE set in the first _open() call, because it might fail under
+ * some circumstances. For details, see Ralf Brown's Interrupt List,
+ * description of INT 0x21, function 0x3D.
+ */
+ fd = _open(filename, O_RDONLY | SH_DENYNO);
+ if (fd < 0)
+ return -1; /* errno from open() call */
+ }
bytes_read = read(fd, &buf, _SYMLINK_FILE_LEN);
_close(fd);
- Raw text -