Fix cppcheck issues

This commit is contained in:
badaix 2023-12-30 11:37:35 +01:00
parent d894cd1853
commit 6e786255e1
11 changed files with 33 additions and 19 deletions

View file

@ -64,7 +64,7 @@ void Daemon::daemonize()
auto user_uid = static_cast<uid_t>(-1);
auto user_gid = static_cast<gid_t>(-1);
std::string user_name;
// std::string user_name;
// #ifdef FREEBSD
// bool had_group = false;
// #endif
@ -76,7 +76,7 @@ void Daemon::daemonize()
throw SnapException("no such user \"" + user_ + "\"");
user_uid = pwd->pw_uid;
user_gid = pwd->pw_gid;
user_name = strdup(user_.c_str());
// user_name = strdup(user_.c_str());
/// this is needed by libs such as arts
setenv("HOME", pwd->pw_dir, 1);
}