]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/gpgv.cc
improve apt.8.xml
[apt.git] / apt-pkg / contrib / gpgv.cc
index 31db7d5feb3bdd08b964f1be5f562d830607d992..f57a72d8640fe099c451357eb39ba52aaaaf7327 100644 (file)
@@ -10,6 +10,7 @@
 #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>
                                                                        /*}}}*/
 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;
-   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());
 }
                                                                        /*}}}*/
@@ -154,7 +148,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
         if (sigFd != -1)
            unlink(data);
         ioprintf(std::cerr, "Splitting up %s into data and signature failed", File.c_str());
-        exit(EINTERNAL);
+        exit(112);
       }
       Args.push_back(sig);
       Args.push_back(data);