Skip to content
Commit ea13e243 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

Correct a problem that was causing an apparent directory to be reported as a...

Correct a problem that was causing an apparent directory to be reported as a file instead of a directory by opendir.

This happened after adding these three new procfs entries:

  fs/block
  fs/mount
  fs/usage

Of course, there is no directory fs in this case, only three files that have fs/ in their relative pathnames.  The logic was detecting that fs was the name of the enty to report, but it was then declaring that fs was a file (because fs/block is of type file).

This was fixed by adding a check for matching lenghts.  i.e., if strlen(fs) != strlen(fs/block), then report fs as a directory instead of a file.
parent 1ed816de
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment