2250
if (! strcmp (arg, "never")) {
2251
class->oom_adj = -17;
2251
if (! strcmp (arg, "score")) {
2252
nih_local char *scorearg = NULL;
2254
/* Update error position to the score value */
2259
scorearg = nih_config_next_arg (NULL, file, len,
2264
if (! strcmp (scorearg, "never")) {
2265
class->oom_score_adj = -1000;
2268
class->oom_score_adj = (int)strtol (scorearg, &endptr, 10);
2269
if (errno || *endptr ||
2270
(class->oom_score_adj < -1000) ||
2271
(class->oom_score_adj > 1000))
2272
nih_return_error (-1, PARSE_ILLEGAL_OOM,
2273
_(PARSE_ILLEGAL_OOM_SCORE_STR));
2275
} else if (! strcmp (arg, "never")) {
2276
class->oom_score_adj = -1000;
2254
class->oom_adj = (int)strtol (arg, &endptr, 10);
2255
if (errno || *endptr || (class->oom_adj < -17) || (class->oom_adj > 15))
2279
oom_adj = (int)strtol (arg, &endptr, 10);
2280
class->oom_score_adj = (oom_adj * 1000) / ((oom_adj < 0) ? 17 : 15);
2281
if (errno || *endptr || (oom_adj < -17) || (oom_adj > 15))
2256
2282
nih_return_error (-1, PARSE_ILLEGAL_OOM,
2257
2283
_(PARSE_ILLEGAL_OOM_STR));