From: Chris Hanson Date: Mon, 18 Nov 1996 21:13:55 +0000 (+0000) Subject: Ignore sharing-violation errors when reading file attributes, treating X-Git-Tag: 20090517-FFI~5326 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c5d6c7056e59b28937e02b9c708b39571f90aca3;p=mit-scheme.git Ignore sharing-violation errors when reading file attributes, treating the file as non-existent. This is not correct, but until the NT errors are properly mapped, the runtime system won't be able to handle this error. --- diff --git a/v7/src/microcode/prntfs.c b/v7/src/microcode/prntfs.c index bee305b1d..e0a13dd31 100644 --- a/v7/src/microcode/prntfs.c +++ b/v7/src/microcode/prntfs.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prntfs.c,v 1.7 1996/10/07 17:54:58 cph Exp $ +$Id: prntfs.c,v 1.8 1996/11/18 21:13:55 cph Exp $ Copyright (c) 1993-96 Massachusetts Institute of Technology @@ -54,6 +54,11 @@ static void EXFUN (protect_fd, (int fd)); #ifndef FILE_TOUCH_OPEN_TRIES #define FILE_TOUCH_OPEN_TRIES 5 #endif + +#define STAT_IGNORE_ERROR_P(code) \ + (((code) == ERROR_FILE_NOT_FOUND) \ + || ((code) == ERROR_PATH_NOT_FOUND) \ + || ((code) == ERROR_SHARING_VIOLATION)) struct file_info { @@ -94,7 +99,7 @@ get_file_info (const char * namestring, struct file_info * info) DWORD code = (GetLastError ()); if (hfile != INVALID_HANDLE_VALUE) (void) CloseHandle (hfile); - if (! ((code == ERROR_FILE_NOT_FOUND) || (code == ERROR_PATH_NOT_FOUND))) + if (!STAT_IGNORE_ERROR_P (code)) error_system_call (code, syscall_lstat); return (0); } @@ -114,7 +119,7 @@ create_file_for_info (const char * namestring) if (hfile == INVALID_HANDLE_VALUE) { DWORD code = (GetLastError ()); - if (! ((code == ERROR_FILE_NOT_FOUND) || (code == ERROR_PATH_NOT_FOUND))) + if (!STAT_IGNORE_ERROR_P (code)) error_system_call (code, syscall_open); } return (hfile); @@ -460,8 +465,7 @@ DEFINE_PRIMITIVE ("NT-GET-FILE-ATTRIBUTES", Prim_NT_get_file_attributes, 1, 1, 0 if (attributes == 0xFFFFFFFF) { DWORD error_code = (GetLastError ()); - if (! ((error_code == ERROR_FILE_NOT_FOUND) - || (error_code == ERROR_PATH_NOT_FOUND))) + if (!STAT_IGNORE_ERROR_P (error_code)) error_system_call (error_code, syscall_stat); PRIMITIVE_RETURN (SHARP_F); }