X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Ffstool.c;fp=src%2Ffstool.c;h=be01c3160268184d60e852d03c7c769ad018a84e;hb=fc28db1eb4146796ec27c2fb15780d6303120261;hp=4bb8b8f187afe2c75c49041f2de277a160854e42;hpb=8cf13bb177d92c93eb73dc8939777150536c2d00;p=util-vserver.git diff --git a/src/fstool.c b/src/fstool.c index 4bb8b8f..be01c31 100644 --- a/src/fstool.c +++ b/src/fstool.c @@ -1,4 +1,4 @@ -// $Id: fstool.c,v 1.8 2004/08/19 14:29:25 ensc Exp $ --*- c -*-- +// $Id: fstool.c 2403 2006-11-24 23:06:08Z dhozac $ --*- c -*-- // Copyright (C) 2004 Enrico Scholz // @@ -156,8 +156,13 @@ processFile(char const *path) } if (S_ISDIR(st.st_mode) && !global_args->do_display_dir) { + int cur_dir = Eopen(".", O_RDONLY, 0); + uint64_t ret; Echdir(path); - return iterateFilesystem(path); + ret = iterateFilesystem(path); + Efchdir(cur_dir); + Eclose(cur_dir); + return ret; } else return handleFile(path, path) ? 0 : 1; @@ -213,7 +218,7 @@ int main(int argc, char *argv[]) default : WRITE_MSG(2, "Try '"); WRITE_STR(2, argv[0]); - WRITE_MSG(2, " --help\" for more information.\n"); + WRITE_MSG(2, " --help' for more information.\n"); return EXIT_FAILURE; break; }