diff options
author | Michael Vogt <mvo@debian.org> | 2013-12-22 22:15:52 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2013-12-22 22:15:52 +0100 |
commit | 68e0172140872d8044b3c768a6bea3ac58d426c4 (patch) | |
tree | 8562f0708130ee1b628e256c49be31f8c1c7e1b2 /apt-pkg/contrib/gpgv.cc | |
parent | 38beb8b5936e9d85a5bb99bf3860f082bbe34439 (diff) |
factor GetTempDir out
Diffstat (limited to 'apt-pkg/contrib/gpgv.cc')
-rw-r--r-- | apt-pkg/contrib/gpgv.cc | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 8f619fee2..f57a72d86 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -22,20 +22,9 @@ /*}}}*/ static char * GenerateTemporaryFileTemplate(const char *basename) /*{{{*/ { - const char *tmpdir = getenv("TMPDIR"); - -#ifdef P_tmpdir - if (!tmpdir) - tmpdir = P_tmpdir; -#endif - - // check that tmpdir is set and exists - struct stat st; - if (!tmpdir || stat(tmpdir, &st) != 0) - tmpdir = "/tmp"; - std::string out; - strprintf(out, "%s/%s.XXXXXX", tmpdir, basename); + std::string tmpdir = GetTempDir(); + strprintf(out, "%s/%s.XXXXXX", tmpdir.c_str(), basename); return strdup(out.c_str()); } /*}}}*/ |