This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Change in errno.cc



Hi,

If one process has opened a file exclusively or has locked a part of the file,
then other processes, which try to open this file, will get either the error
code ERROR_SHARING_VIOLATION or the error code ERROR_LOCK_VIOLATION.
Both error codes are mapped to EACCES in errno.cc. This doesn't reflect the
real situation.
So I want to suggest the following change to errno.cc:

Change the mapping of the above error codes to ETXTBSY.

The patch is attached.

Regards,
Corinna

ChangeLog:
==========

Thu Jul 1 2:14:00  Corinna Vinschen  <corinna@vinschen.de>

	* errno.cc: Changed the error mapping of ERROR_SHARING_VIOLATION
	and ERROR_LOCK_VIOLATION from EACCES to ETXTBSY.
Index: errno.cc
===================================================================
RCS file: /src/cvsroot/winsup-990627/errno.cc,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 errno.cc
--- errno.cc	1999/06/28 09:00:06	1.1.1.1
+++ errno.cc	1999/06/30 23:59:37
@@ -42,8 +42,8 @@ errmap[] =
   X (NO_MORE_FILES,		ENMFILE),
   X (WRITE_PROTECT,		EROFS),
   X (BAD_UNIT,			ENODEV),
-  X (SHARING_VIOLATION,		EACCES),
-  X (LOCK_VIOLATION,		EACCES),
+  X (SHARING_VIOLATION,		ETXTBSY),
+  X (LOCK_VIOLATION,		ETXTBSY),
   X (SHARING_BUFFER_EXCEEDED,	ENOLCK),
   X (HANDLE_EOF,		ENODATA),
   X (HANDLE_DISK_FULL,		ENOSPC),

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]