Never signal an error from file probe. There are too many things that
authorChris Hanson <org/chris-hanson/cph>
Tue, 7 Feb 1995 23:53:05 +0000 (23:53 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 7 Feb 1995 23:53:05 +0000 (23:53 +0000)
can go wrong, so it's pointless to try to enumerate them.

v7/src/microcode/os2fs.c

index 5b1095e4fd99444988778632f79e40073ad6df57..2ea6f0db873dccd3fd88ab74e3d323dc294f48ba 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: os2fs.c,v 1.4 1995/01/16 20:57:00 cph Exp $
+$Id: os2fs.c,v 1.5 1995/02/07 23:53:05 cph Exp $
 
 Copyright (c) 1994-95 Massachusetts Institute of Technology
 
@@ -78,25 +78,16 @@ OS2_read_file_status (const char * filename)
       (name [1]) = '.';
       (name [2]) = '\0';
     }
-  XTD_API_CALL
-    (dos_query_path_info,
-     (name, FIL_STANDARD, (&info), (sizeof (info))),
-     {
-       if ((rc == ERROR_FILE_NOT_FOUND)
-          || (rc == ERROR_PATH_NOT_FOUND)
-          /* ERROR_ACCESS_DENIED can occur if the file is a symbolic
-             link on a unix system mounted via NFS, and if the
-             symbolic link points to a nonexistent file.  */
-          || (rc == ERROR_ACCESS_DENIED)
-          || (rc == ERROR_INVALID_DRIVE)
-          || (rc == ERROR_NOT_READY)
-          || (rc == ERROR_NOT_DOS_DISK)
-          || (rc == ERROR_DISK_CHANGE)
-          || (rc == ERROR_FILENAME_EXCED_RANGE)
-          || (rc == ERROR_INVALID_FSD_NAME)
-          || (rc == ERROR_INVALID_PATH))
-        return (0);
-     });
+  {
+    APIRET rc
+      = (dos_query_path_info (name, FIL_STANDARD, (&info), (sizeof (info))));
+    /* So many different things can go wrong here that it is a bad
+       idea to attempt to enumerate them.  Several times I have
+       thought I had all the possible conditions and later discovered
+       that I was wrong.  */
+    if (rc != NO_ERROR)
+      return (0);
+  }
   return (&info);
 }