From fec3fd1f8ac1db9ed87b79bd3eb5e38aa835e881 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 26 Jul 2014 13:30:40 -0500 Subject: Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle. --- lib/lib.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/lib.h') diff --git a/lib/lib.h b/lib/lib.h index 11a1018c..34c78a26 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -60,7 +60,8 @@ struct dirtree { long extra; // place for user to store their stuff (can be pointer) struct stat st; char *symlink; - int data; // dirfd for directory, linklen for symlink, -1 = comeagain + int data; // dirfd for directory, linklen for symlink + char again; char name[]; }; @@ -70,8 +71,8 @@ int dirtree_notdotdot(struct dirtree *catch); int dirtree_parentfd(struct dirtree *node); struct dirtree *dirtree_handle_callback(struct dirtree *new, int (*callback)(struct dirtree *node)); -void dirtree_recurse(struct dirtree *node, - int (*callback)(struct dirtree *node), int symfollow); +int dirtree_recurse(struct dirtree *node, int (*callback)(struct dirtree *node), + int symfollow); struct dirtree *dirtree_read(char *path, int (*callback)(struct dirtree *node)); // help.c -- cgit v1.2.3