Browse Source

xsd: Add 'never' value to exec_on field

Serj Kalichev 2 years ago
parent
commit
aa05198c24
2 changed files with 6 additions and 3 deletions
  1. 2 1
      klish.xsd
  2. 4 2
      klish/ksession/kexec.c

+ 2 - 1
klish.xsd

@@ -344,7 +344,7 @@
 *
 * [interactive="true/false"] - Is action interactive.
 *
-* [exec_on="fail/success/always"] - ACTION's execution depends on
+* [exec_on="fail/success/always/never"] - ACTION's execution depends on
 *	return code of previous elements of ACTION chain. If the
 *	condition is not met then ACTION will not be executed. The "always"
 *	value means that ACTION will be always executed and chain return
@@ -372,6 +372,7 @@
 			<xs:enumeration value="fail"/>
 			<xs:enumeration value="success"/>
 			<xs:enumeration value="always"/>
+			<xs:enumeration value="never"/>
 		</xs:restriction>
 	</xs:simpleType>
 

+ 4 - 2
klish/ksession/kexec.c

@@ -181,9 +181,11 @@ static int exec_action(kcontext_t *context, const kaction_t *action, pid_t *pid)
 {
 	context = context;
 	action = action;
-	*pid = -1;
 
-	printf("DDD: exec_action\n");
+	if (pid)
+		*pid = -1;
+
+	printf("DDD: exec_action [%s]\n", kaction_script(action));
 
 	return 0;
 }