]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/gpgv.cc
improve apt.8.xml
[apt.git] / apt-pkg / contrib / gpgv.cc
index f47e7ea4868f1334b7c7a5b7cbc1a5c41af690f2..f57a72d8640fe099c451357eb39ba52aaaaf7327 100644 (file)
@@ -10,6 +10,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <unistd.h>
 
 #include<apt-pkg/configuration.h>
 #include<apt-pkg/error.h>
 
 #include<apt-pkg/configuration.h>
 #include<apt-pkg/error.h>
                                                                        /*}}}*/
 static char * GenerateTemporaryFileTemplate(const char *basename)      /*{{{*/
 {
                                                                        /*}}}*/
 static char * GenerateTemporaryFileTemplate(const char *basename)      /*{{{*/
 {
-   const char *tmpdir = getenv("TMPDIR");
-#ifdef P_tmpdir
-   if (!tmpdir)
-      tmpdir = P_tmpdir;
-#endif
-   if (!tmpdir)
-      tmpdir = "/tmp";
-
    std::string out;
    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());
 }
                                                                        /*}}}*/
    return strdup(out.c_str());
 }
                                                                        /*}}}*/