- {
- if (_config->FindB("Debug::Acquire::gpgv", false))
- {
- std::cerr << "Preparing to exec: " << gpgvpath
- << " --status-fd 3 --keyring " << pubringpath
- << " " << file << " " << outfile << std::endl;
- }
- int nullfd = open("/dev/null", O_RDONLY);
- close(fd[0]);
- // Redirect output to /dev/null; we read from the status fd
- dup2(nullfd, STDOUT_FILENO);
- dup2(nullfd, STDERR_FILENO);
- // Redirect the pipe to the status fd (3)
- dup2(fd[1], 3);
-
- putenv("LANG=");
- putenv("LC_ALL=");
- putenv("LC_MESSAGES=");
- execlp(gpgvpath.c_str(), gpgvpath.c_str(), "--status-fd", "3", "--keyring",
- pubringpath.c_str(), file, outfile, NULL);
-
- exit(111);
- }
+ ExecGPGV(outfile, file, 3, fd);