aboutsummaryrefslogtreecommitdiff
path: root/lib/dirtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dirtree.c')
-rw-r--r--lib/dirtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dirtree.c b/lib/dirtree.c
index e119c5d1..361686aa 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -138,7 +138,7 @@ void dirtree_recurse(struct dirtree *node,
struct dirent *entry;
DIR *dir;
- if (!(dir = fdopendir(node->data))) {
+ if (node->data == -1 || !(dir = fdopendir(node->data))) {
char *path = dirtree_path(node, 0);
perror_msg("No %s", path);
free(path);