mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
core/service: correct comment in service_deserialize_exec_command()
The index of ExecCommand is serialized, not PID.
This commit is contained in:
@@ -3190,7 +3190,7 @@ int service_deserialize_exec_command(
|
||||
bool control, found = false, last = false;
|
||||
int r;
|
||||
|
||||
enum ExecCommandState {
|
||||
enum {
|
||||
STATE_EXEC_COMMAND_TYPE,
|
||||
STATE_EXEC_COMMAND_INDEX,
|
||||
STATE_EXEC_COMMAND_PATH,
|
||||
@@ -3216,6 +3216,7 @@ int service_deserialize_exec_command(
|
||||
break;
|
||||
|
||||
switch (state) {
|
||||
|
||||
case STATE_EXEC_COMMAND_TYPE:
|
||||
id = service_exec_command_from_string(arg);
|
||||
if (id < 0)
|
||||
@@ -3223,11 +3224,12 @@ int service_deserialize_exec_command(
|
||||
|
||||
state = STATE_EXEC_COMMAND_INDEX;
|
||||
break;
|
||||
|
||||
case STATE_EXEC_COMMAND_INDEX:
|
||||
/* PID 1234 is serialized as either '1234' or '+1234'. The second form is used to
|
||||
* mark the last command in a sequence. We warn if the deserialized command doesn't
|
||||
* match what we have loaded from the unit, but we don't need to warn if that is the
|
||||
* last command. */
|
||||
/* ExecCommand index 1234 is serialized as either '1234' or '+1234'. The second form
|
||||
* is used to mark the last command in a sequence. We warn if the deserialized command
|
||||
* doesn't match what we have loaded from the unit, but we don't need to warn if
|
||||
* that is the last command. */
|
||||
|
||||
r = safe_atou(arg, &idx);
|
||||
if (r < 0)
|
||||
@@ -3236,15 +3238,18 @@ int service_deserialize_exec_command(
|
||||
|
||||
state = STATE_EXEC_COMMAND_PATH;
|
||||
break;
|
||||
|
||||
case STATE_EXEC_COMMAND_PATH:
|
||||
path = TAKE_PTR(arg);
|
||||
state = STATE_EXEC_COMMAND_ARGS;
|
||||
break;
|
||||
|
||||
case STATE_EXEC_COMMAND_ARGS:
|
||||
r = strv_extend(&argv, arg);
|
||||
if (r < 0)
|
||||
return r;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert_not_reached();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user