From 07a135a6bf9bd7352aa7445c7d169a789f8ae1a9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 3 May 2000 16:11:11 +0000 Subject: [PATCH] * errno.cc (errmap): Map ERROR_BAD_NETPATH to new errno ENOSHARE. (_sys_errlist): Add entry for ENOSHARE. (strerror): Add case for ENOSHARE. * syscalls.cc (stat_worker): Check for errno ENOSHARE. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/errno.cc | 8 ++++++-- winsup/cygwin/syscalls.cc | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 617931a9a..d75ee33b7 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +Wed May 3 18:07:00 2000 Corinna Vinschen + + * errno.cc (errmap): Map ERROR_BAD_NETPATH to new errno ENOSHARE. + (_sys_errlist): Add entry for ENOSHARE. + (strerror): Add case for ENOSHARE. + * syscalls.cc (stat_worker): Check for errno ENOSHARE. + Wed May 3 17:28:00 2000 Corinna Vinschen * Makefile.in: Add dependencies for fhandler_random.o diff --git a/winsup/cygwin/errno.cc b/winsup/cygwin/errno.cc index 5921f448e..2f51ac588 100644 --- a/winsup/cygwin/errno.cc +++ b/winsup/cygwin/errno.cc @@ -50,7 +50,7 @@ errmap[] = X (NOT_SUPPORTED, ENOSYS), X (REM_NOT_LIST, ENONET), X (DUP_NAME, ENOTUNIQ), - X (BAD_NETPATH, ENXIO), + X (BAD_NETPATH, ENOSHARE), X (FILE_EXISTS, EEXIST), X (CANNOT_MAKE, EPERM), X (INVALID_PARAMETER, EINVAL), @@ -279,7 +279,8 @@ extern const char __declspec(dllexport) * const _sys_errlist[]= /* EDQUOT 132 */ "Quota exceeded", /* ESTALE 133 */ "Stale NFS file handle", /* ENOTSUP 134 */ "134", -/* ENOMEDIUM 135 */ "no medium" +/* ENOMEDIUM 135 */ "no medium", +/* ENOSHARE 136 */ "No such host or network path" }; int __declspec(dllexport) _sys_nerr = @@ -652,6 +653,9 @@ strerror (int errnum) case ENOMEDIUM: error = "no medium"; break; + case ENOSHARE: + error = "No such host or network path"; + break; default: #ifdef _MT_SAFE char *buf= _reent_winsup()->_strerror_buf; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index d45909883..529c7f627 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1030,7 +1030,8 @@ stat_worker (const char *caller, const char *name, struct stat *buf, buf->st_nlink = (dtype == DRIVE_REMOTE ? 1 : num_entries (real_path.get_win32 ())); } - else if (atts != -1 || (!oret && get_errno () != ENOENT)) + else if (atts != -1 || (!oret && get_errno () != ENOENT + && get_errno () != ENOSHARE)) { /* Unfortunately, the above open may fail if the file exists, though. So we have to care for this case here, too. */