1 /* vi: set sw=4 ts=4: */
3 * Mini mktemp implementation for busybox
6 * Copyright (C) 2000 by Daniel Jacobowitz
7 * Written by Daniel Jacobowitz <dan@debian.org>
9 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
19 int mktemp_main(int argc, char **argv);
20 int mktemp_main(int argc, char **argv)
22 unsigned long flags = getopt32(argc, argv, "dqt");
25 if (optind + 1 != argc)
31 char *dir = getenv("TMPDIR");
32 if (dir && *dir != '\0')
33 chp = concat_path_file(dir, chp);
35 chp = concat_path_file("/tmp/", chp);
39 if (mkdtemp(chp) == NULL)