Serj Kalichev 2 лет назад
Родитель
Сommit
fe207aafda
4 измененных файлов с 26 добавлено и 0 удалено
  1. 2 0
      bin/klishd/klishd.c
  2. 2 0
      klish/kscheme/kaction.c
  3. 19 0
      klish/ksession/kexec.c
  4. 3 0
      klish/ktp/ktpd_session.c

+ 2 - 0
bin/klishd/klishd.c

@@ -651,6 +651,7 @@ static bool_t client_ev(faux_eloop_t *eloop, faux_eloop_type_e type,
 			// Someting went wrong
 			faux_eloop_del_fd(eloop, info->fd);
 			syslog(LOG_ERR, "Problem with async output");
+			return BOOL_FALSE; // Stop event loop
 		}
 	}
 
@@ -660,6 +661,7 @@ static bool_t client_ev(faux_eloop_t *eloop, faux_eloop_type_e type,
 			// Someting went wrong
 			faux_eloop_del_fd(eloop, info->fd);
 			syslog(LOG_ERR, "Problem with async input");
+			return BOOL_FALSE; // Stop event loop
 		}
 	}
 

+ 2 - 0
klish/kscheme/kaction.c

@@ -17,6 +17,8 @@ struct kaction_s {
 	char *lock; // Named lock
 	bool_t interrupt;
 	bool_t interactive;
+//	bool_t permanent; // Should it be executed on 'dry-run'
+//	bool_t async;
 	kaction_cond_e exec_on;
 	bool_t update_retcode;
 	char *script;

+ 19 - 0
klish/ksession/kexec.c

@@ -106,3 +106,22 @@ bool_t kexec_add(kexec_t *exec, kcontext_t *context)
 
 	return BOOL_TRUE;
 }
+
+
+bool_t kexec_execute(kexec_t *exec)
+{
+	faux_list_node_t *iter = NULL;
+	kcontext_t *context = NULL;
+
+	assert(exec);
+	if (!exec)
+		return BOOL_FALSE;
+
+	iter = faux_list_tail(exec->contexts);
+	while ((context = faux_list_data(iter))) {
+	
+		iter = faux_list_prev_node(iter);
+	}
+
+	return BOOL_TRUE;
+}

+ 3 - 0
klish/ktp/ktpd_session.c

@@ -93,6 +93,9 @@ static bool_t ktpd_session_process_cmd(ktpd_session_t *session, faux_msg_t *msg)
 		faux_error_show(error);
 	}
 
+
+//	ktpd_session_exec(session, exec);
+
 //	kpargv_debug(pargv);
 //	if (kpargv_status(pargv) != KPARSE_OK) {
 //		char *error = NULL;