mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Fix parse/diff of command line args, e.g., nginx -g 'daemon off;'
Starting a service like this works fine:
service [2345789] env:-/etc/default/nginx nginx -g 'daemon off;'
However, on `initctl reload` the previous argument was lost while
parsing the end of the new one. So the comparison always resulted
in a 'diff' causing the service to be unnecessarily restarted.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -1244,6 +1244,7 @@ static char *parse_name(char *cmd, char *arg)
|
||||
*/
|
||||
static void parse_cmdline_args(svc_t *svc, char *cmd, char **args)
|
||||
{
|
||||
char prev[MAX_ARG_LEN];
|
||||
int diff = 0;
|
||||
char sep = 0;
|
||||
char *arg;
|
||||
@@ -1258,7 +1259,6 @@ static void parse_cmdline_args(svc_t *svc, char *cmd, char **args)
|
||||
* array to be zero-terminated.
|
||||
*/
|
||||
while ((arg = strtok_r(NULL, " ", args)) && i < (MAX_NUM_SVC_ARGS - 1)) {
|
||||
char prev[sizeof(svc->args[0])] = { 0 };
|
||||
char ch = arg[0];
|
||||
size_t len;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user