[PATCH] Option to choose another root tmp-directory in varnishtest & make check
Poul-Henning Kamp
phk at phk.freebsd.dk
Tue Oct 1 13:44:47 CEST 2013
In message <524AABC3.8050800 at uplex.de>, Geoff Simmons writes:
Just some nitpickery, fix and commit without further review:
>diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
>index 04aba0d..751a915 100644
>--- a/bin/varnishtest/vtc_main.c
>+++ b/bin/varnishtest/vtc_main.c
>@@ -85,6 +85,7 @@ static int vtc_verbosity = 1; /* Verbosity Level */
> static int vtc_good;
> static int vtc_fail;
> static int leave_temp;
>+static char *tmp;
Can we please call it "tmpdir" instead ?
>- fprintf(stderr, FMT, "-l", "Leave /tmp/vtc.* if test fails");
>- fprintf(stderr, FMT, "-L", "Always leave /tmp/vtc.*");
>+ fprintf(stderr, FMT, "-l", "Leave $TMPDIR/vtc.* if test fails");
>+ fprintf(stderr, FMT, "-L", "Always leave $TMPDIR/vtc.*");
I'd prefer to not give the impression TMPDIR is mandatory:
>+ fprintf(stderr, FMT, "-l", "Leave temporary vtc.* if test fails");
>+ fprintf(stderr, FMT, "-L", "Always leave temporary vtc.*");
(also in .rst files)
> extmacro_def("varnishd", "varnishd"); /* Default to path lookup */
>+ tmp = strdup("/tmp");
>+ if (getenv("TMPDIR") != NULL)
>+ tmp = strdup(getenv("TMPDIR"));
Don't waste memory :-)
>+ if (getenv("TMPDIR") != NULL)
>+ tmp = strdup(getenv("TMPDIR"));
>+ else
>+ tmp = strdup("/tmp");
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the varnish-dev
mailing list