procfs: Use dirent.h macros when testing directory entry type

This commit is contained in:
Gregory Nutt 2015-11-28 08:52:21 -06:00
parent 25f48e5829
commit 1f8f097783
3 changed files with 5 additions and 5 deletions

@ -1 +1 @@
Subproject commit 3d2cd73b92c99a5880354fe11f5d7f29bc8775e8 Subproject commit 9a469c139e90739c838009ca1e721e466ad42548

@ -1 +1 @@
Subproject commit 18c27d653564ec78841d6912597155fde62467c7 Subproject commit 60a36debd08e046a5e1768ebc5ba5fb17a337c83

View File

@ -981,9 +981,9 @@ static int proc_open(FAR struct file *filep, FAR const char *relpath,
/* The node must be a file, not a directory */ /* The node must be a file, not a directory */
if (node->dtype != DTYPE_FILE) if (!DIRENT_ISFILE(node->dtype))
{ {
fdbg("ERROR: Path \"%s\" is a directory\n", relpath); fdbg("ERROR: Path \"%s\" is not a regular file\n", relpath);
return -EISDIR; return -EISDIR;
} }
@ -1238,7 +1238,7 @@ static int proc_opendir(FAR const char *relpath, FAR struct fs_dirent_s *dir)
/* The node must be a directory, not a file */ /* The node must be a directory, not a file */
if (node->dtype != DTYPE_DIRECTORY) if (!DIRENT_ISDIRECTORY(node->dtype))
{ {
fdbg("ERROR: Path \"%s\" is not a directory\n", relpath); fdbg("ERROR: Path \"%s\" is not a directory\n", relpath);
kmm_free(procdir); kmm_free(procdir);