On Mon, Oct 07, 2019 at 11:18:00PM +0400, marcandre.lureau@xxxxxxxxxx wrote: > From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> > > Instead of outputing files to current directory, allow to specificy an > output directory. This helps with meson build system out-of-tree > support. Again, I think this is a good idea, even if we don't use meson. I'd prefer to see this as the way we always invoke dumptrees, rather than supporting both paths, however. > > Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> > --- > tests/dumptrees.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/tests/dumptrees.c b/tests/dumptrees.c > index b2f5b26..d5eb480 100644 > --- a/tests/dumptrees.c > +++ b/tests/dumptrees.c > @@ -32,6 +32,13 @@ int main(int argc, char *argv[]) > { > int i; > > + if (argc > 1) { > + if (chdir(argv[1]) != 0) { > + perror("chdir()"); > + return 1; > + } > + } > + > for (i = 0; i < NUM_TREES; i++) { > void *blob = trees[i].blob; > const char *filename = trees[i].filename; -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
signature.asc
Description: PGP signature