/* -*-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
#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))
\f
struct file_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);
}
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);
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);
}