Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 47f7adfcb0fc78bf4b84e9af95a9d8028da013e3)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 06e724e1d8a583c6604ec5b4b3bdccf050818eda)
@@ -756,8 +756,9 @@
 {
 	struct stat stat;
-	int rc;
-
-	rc = fstat(fildes, &stat);
-
+	
+	int rc = fstat(fildes, &stat);
+	if (rc != 0)
+		return rc;
+	
 	if (!stat.device)
 		return -1;
