cmdline: no need to check for nice values
This commit is contained in:
parent
494a5f63cd
commit
28d2220b1e
@ -834,10 +834,6 @@ std::unique_ptr<nsjconf_t> parseArgs(int argc, char* argv[]) {
|
|||||||
break;
|
break;
|
||||||
case 0x903:
|
case 0x903:
|
||||||
nsjconf->nice_level = (int)strtol(optarg, NULL, 0);
|
nsjconf->nice_level = (int)strtol(optarg, NULL, 0);
|
||||||
if ((nsjconf->nice_level < -20) || (nsjconf->nice_level > -20)) {
|
|
||||||
LOG_W("Incorrect niceness setting!");
|
|
||||||
nsjconf->nice_level = 19;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cmdlineUsage(argv[0]);
|
cmdlineUsage(argv[0]);
|
||||||
|
@ -100,9 +100,10 @@ static bool containPrepareEnv(nsjconf_t* nsjconf) {
|
|||||||
PLOG_E("personality(%lx)", nsjconf->personality);
|
PLOG_E("personality(%lx)", nsjconf->personality);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
LOG_D("setpriority(%d)", nsjconf->nice_level);
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (setpriority(PRIO_PROCESS, 0, nsjconf->nice_level) == -1 && errno != 0) {
|
if (setpriority(PRIO_PROCESS, 0, nsjconf->nice_level) == -1 && errno != 0) {
|
||||||
PLOG_W("setpriority(%" PRId32 ")", nsjconf->nice_level);
|
PLOG_W("setpriority(%d)", nsjconf->nice_level);
|
||||||
}
|
}
|
||||||
if (!nsjconf->skip_setsid) {
|
if (!nsjconf->skip_setsid) {
|
||||||
setsid();
|
setsid();
|
||||||
|
Loading…
Reference in New Issue
Block a user