No need to use '== true'

This commit is contained in:
Robert Swiecki 2017-10-18 15:41:16 +02:00
parent 9465e794eb
commit 5ef11f65a4
5 changed files with 11 additions and 11 deletions

6
caps.c
View File

@ -177,7 +177,7 @@ static bool CapsInitNsKeepCaps(cap_user_data_t cap_data)
/* Copy all permitted caps to the inheritable set */
dbgmsg[0] = '\0';
for (size_t i = 0; i < ARRAYSIZE(capNames); i++) {
if (capsGetPermitted(cap_data, capNames[i].val) == true) {
if (capsGetPermitted(cap_data, capNames[i].val)) {
utilSSnPrintf(dbgmsg, sizeof(dbgmsg), " %s", capNames[i].name);
capsSetInheritable(cap_data, capNames[i].val);
}
@ -254,10 +254,10 @@ bool capsInitNs(struct nsjconf_t* nsjconf)
* Make sure all other caps (those which were not explicitly requested) are removed from the
* bounding set. We need to have CAP_SETPCAP to do that now
*/
if (capsGetEffective(cap_data, CAP_SETPCAP) == true) {
if (capsGetEffective(cap_data, CAP_SETPCAP)) {
dbgmsg[0] = '\0';
for (size_t i = 0; i < ARRAYSIZE(capNames); i++) {
if (capsGetInheritable(cap_data, capNames[i].val) == true) {
if (capsGetInheritable(cap_data, capNames[i].val)) {
continue;
}
utilSSnPrintf(dbgmsg, sizeof(dbgmsg), " %s", capNames[i].name);

View File

@ -245,10 +245,10 @@ static bool containMakeFdsCOEProc(struct nsjconf_t* nsjconf)
static bool containMakeFdsCOE(struct nsjconf_t* nsjconf)
{
if (containMakeFdsCOEProc(nsjconf) == true) {
if (containMakeFdsCOEProc(nsjconf)) {
return true;
}
if (containMakeFdsCOENaive(nsjconf) == true) {
if (containMakeFdsCOENaive(nsjconf)) {
return true;
}
LOG_E("Couldn't mark relevant file-descriptors as close-on-exec with any known method");

6
log.c
View File

@ -57,7 +57,7 @@ bool logInitLogFile(struct nsjconf_t* nsjconf)
log_fd = nsjconf->log_fd;
log_level = nsjconf->loglevel;
if (nsjconf->logfile == NULL && nsjconf->daemonize == true) {
if (nsjconf->logfile == NULL && nsjconf->daemonize) {
nsjconf->logfile = _LOG_DEFAULT_FILE;
}
if (nsjconf->logfile == NULL) {
@ -82,7 +82,7 @@ void logLog(enum llevel_t ll, const char* fn, int ln, bool perr, const char* fmt
}
char strerr[512];
if (perr == true) {
if (perr) {
snprintf(strerr, sizeof(strerr), "%s", strerror(errno));
}
struct ll_t {
@ -124,7 +124,7 @@ void logLog(enum llevel_t ll, const char* fn, int ln, bool perr, const char* fmt
va_start(args, fmt);
vdprintf(log_fd, fmt, args);
va_end(args);
if (perr == true) {
if (perr) {
dprintf(log_fd, ": %s", strerr);
}
if (log_fd_isatty) {

View File

@ -119,7 +119,7 @@ static void nsjailListenMode(struct nsjconf_t* nsjconf)
close(listenfd);
return;
}
if (nsjailShowProc == true) {
if (nsjailShowProc) {
nsjailShowProc = false;
subprocDisplay(nsjconf);
}
@ -145,7 +145,7 @@ static int nsjailStandaloneMode(struct nsjconf_t* nsjconf)
subprocRunChild(nsjconf, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO);
continue;
}
if (nsjailShowProc == true) {
if (nsjailShowProc) {
nsjailShowProc = false;
subprocDisplay(nsjconf);
}

View File

@ -534,7 +534,7 @@ int subprocSystem(const char** argv, char** env)
if (WIFEXITED(status)) {
int exit_code = WEXITSTATUS(status);
LOG_D("PID %d exited with exit code: %d", pid, exit_code);
if (exec_failed == true) {
if (exec_failed) {
return -1;
} else if (exit_code == 0) {
return 0;