Environment variables WIP, fix waiting scheduling issues + CE cancel proc
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m24s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m24s
This commit is contained in:
@@ -8,6 +8,7 @@ $(eval $(call add_lib,libioutil))
|
||||
$(eval $(call add_lib,libterminal))
|
||||
$(eval $(call add_lib,libfat))
|
||||
$(eval $(call add_lib,libmalloc))
|
||||
$(eval $(call add_lib,libdebugconsole))
|
||||
$(eval $(call add_include,libkb))
|
||||
|
||||
cflags += -DPRINTF_INCLUDE_CONFIG_H=1
|
||||
|
||||
16
ce/interp.c
16
ce/interp.c
@@ -5,6 +5,7 @@
|
||||
#include "mprintf.h"
|
||||
#include "parser.h"
|
||||
#include "self.h"
|
||||
#include <debugconsole.h>
|
||||
#include <desc.h>
|
||||
#include <filereader.h>
|
||||
#include <filewriter.h>
|
||||
@@ -339,15 +340,12 @@ static void help (struct context* context) {
|
||||
}
|
||||
|
||||
static void cmd_cancel_proc (void* arg) {
|
||||
int pid = *(int*)arg;
|
||||
int pid = (int)arg;
|
||||
|
||||
char ch = 0;
|
||||
for (;;) {
|
||||
do {
|
||||
mail_receive (&ch, 1);
|
||||
|
||||
if (ch == KB_CTRL ('C'))
|
||||
break;
|
||||
}
|
||||
} while (ch != KB_CTRL ('C'));
|
||||
|
||||
kill (pid);
|
||||
}
|
||||
@@ -407,12 +405,12 @@ static void execute_cmd (struct ast_cmd* cmd, struct context* context) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct process_data* cancel_pdata = process_spawn (&cmd_cancel_proc, &pid);
|
||||
struct process_data* cancel_pdata = process_spawn (&cmd_cancel_proc, (void*)pid);
|
||||
|
||||
wait_for_pid (pid);
|
||||
|
||||
if (kill (cancel_pdata->pid) < 0)
|
||||
free (cancel_pdata);
|
||||
kill (cancel_pdata->pid);
|
||||
process_data_free (cancel_pdata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user