From 770365fc7cdee68d0f397b376d49970ff396a296 Mon Sep 17 00:00:00 2001 From: Tim Shimmin Date: Tue, 4 Dec 2007 05:10:47 +0000 Subject: Add some code to the tree walking to better handle file descriptors. Merge of master-melb:xfs-cmds:30192a by kenmcd. --- getfattr/getfattr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'getfattr/getfattr.c') diff --git a/getfattr/getfattr.c b/getfattr/getfattr.c index 9cabe43..ddd856e 100644 --- a/getfattr/getfattr.c +++ b/getfattr/getfattr.c @@ -346,12 +346,14 @@ int list_attributes(const char *path, int *header_printed) return 0; } -int do_print(const char *path, const struct stat *stat, int walk_flags, void *unused) +int do_print(const char *path, const struct stat *stat, int walk_flags, + void *unused) { int header_printed = 0; if (walk_flags & WALK_TREE_FAILED) { - fprintf(stderr, "%s: %s: %s\n", progname, xquote(path), strerror(errno)); + fprintf(stderr, "%s: %s: %s\n", progname, xquote(path), + strerror(errno)); return 1; } @@ -474,7 +476,8 @@ int main(int argc, char *argv[]) } while (optind < argc) { - had_errors += walk_tree(argv[optind], walk_flags, do_print, NULL); + had_errors += walk_tree(argv[optind], walk_flags, 0, + do_print, NULL); optind++; } -- cgit v1.2.3