summaryrefslogtreecommitdiff
path: root/nuttx/fs/fs_seekdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/fs/fs_seekdir.c')
-rw-r--r--nuttx/fs/fs_seekdir.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nuttx/fs/fs_seekdir.c b/nuttx/fs/fs_seekdir.c
index 781d35f27..c49acef57 100644
--- a/nuttx/fs/fs_seekdir.c
+++ b/nuttx/fs/fs_seekdir.c
@@ -1,7 +1,7 @@
/****************************************************************************
* fs/fs_seekdir.c
*
- * Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008, 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -202,7 +202,12 @@ void seekdir(FAR DIR *dirp, off_t offset)
{
struct fs_dirent_s *idir = (struct fs_dirent_s *)dirp;
- /* Sanity checks */
+ /* Verify that we were provided with a valid directory structure,
+ * A special case is when we enumerate an "empty", unused inode (fd_root
+ * == 0). That is an inode in the pseudo-filesystem that has no
+ * operations and no children. This is a "dangling" directory entry that
+ * has lost its children.
+ */
if (!idir || !idir->fd_root)
{