process: avoid negative number of children

The number_of_children child connections number becomes negative (-1) at
server startup due to signal handlers treatments on minidlna.c init().

Opening the webserver status page with no clients connected the opening
connection shows -1 even if client list show 0 for all in the columns.

When connecting the first client, its own connections column goes to 1
and total goes to 0, and so on always one count behind.

Simply allow: number_of_children-- only if not 0

From SF user negan07
This commit is contained in:
Justin Maggard 2022-02-10 23:48:05 -08:00
parent 5c4895a09b
commit 3c49d66d82

View File

@ -123,7 +123,8 @@ process_handle_child_termination(int signal)
else else
break; break;
} }
number_of_children--; if (number_of_children)
number_of_children--;
remove_process_info(pid); remove_process_info(pid);
} }
} }