Browse Source

Test: Only compute process ID once

master
Riyyi 3 years ago
parent
commit
4fd90cfa43
  1. 2
      test/testdotfile.cpp

2
test/testdotfile.cpp

@ -18,6 +18,7 @@
#include "util/file.h" #include "util/file.h"
#include "util/system.h" #include "util/system.h"
const bool root = !geteuid() ? true : false;
const std::string homeDirectory = "/home/" + Machine::the().username(); const std::string homeDirectory = "/home/" + Machine::the().username();
const size_t homeDirectorySize = homeDirectory.size(); const size_t homeDirectorySize = homeDirectory.size();
@ -25,7 +26,6 @@ void createTestDotfiles(const std::vector<std::string>& fileNames, const std::ve
{ {
VERIFY(fileNames.size() == fileContents.size()); VERIFY(fileNames.size() == fileContents.size());
bool root = !geteuid() ? true : false;
if (root && !asRoot) { if (root && !asRoot) {
setegid(Machine::the().gid()); setegid(Machine::the().gid());
seteuid(Machine::the().uid()); seteuid(Machine::the().uid());

Loading…
Cancel
Save