Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ void s_wait_running_job(int s, int jobid) {
}

void s_set_max_slots(int new_max_slots) {
if (new_max_slots > 0)
if (new_max_slots >= 0) /* -S 0 lets active jobs end without starting new ones. */
max_slots = new_max_slots;
else
warning("Received new_max_slots=%i", new_max_slots);
Expand Down
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ void parse_opts(int argc, char **argv) {
case 'S':
command_line.request = c_SET_MAX_SLOTS;
command_line.max_slots = atoi(optarg);
if (command_line.max_slots < 1) {
fprintf(stderr, "You should set at minimum 1 slot.\n");
if (command_line.max_slots < 0) { /* -S 0 lets active jobs end without starting new ones. */
fprintf(stderr, "You should set to 0 or more slots.\n"); /* was: You should set at minimum 1 slot.\n */
exit(-1);
}
break;
Expand Down