Fixed handling for non existing files.
authorHartmut Birr <osexpert@googlemail.com>
Mon, 1 Apr 2002 22:05:43 +0000 (22:05 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Mon, 1 Apr 2002 22:05:43 +0000 (22:05 +0000)
svn path=/trunk/; revision=2808

reactos/lib/msvcrt/sys_stat/stat.c

index e4b0cc4..5fc7f5e 100644 (file)
@@ -9,6 +9,9 @@ int _stat(const char *path, struct stat *buffer)
   int fd = _open(path,_O_RDONLY);
   int ret;
 
+  if (fd < 0)
+    return -1;
+
   ret = fstat(fd,buffer);
   _close(fd);