Kill task's children when task exits
This commit is contained in:
parent
299e6cbed5
commit
4d42e793b9
3
gui.c
3
gui.c
@ -605,6 +605,7 @@ void gui_raise_to_top(int wh) {
|
||||
windows[window_count - 1] = win;
|
||||
windows[window_count - 1]->zorder = window_count - 1;
|
||||
windows[window_count - 1]->focused = 1;
|
||||
keyboard_set_handler(windows[window_count - 1]->keyboard_dest);
|
||||
}
|
||||
|
||||
void gui_flip() {
|
||||
@ -630,7 +631,6 @@ void gui_flip() {
|
||||
} else if (mouse_pos_x > windows[i]->posx && mouse_pos_x < windows[i]->posx + 25 && mouse_pos_y > windows[i]->posy - 25 && mouse_pos_y < windows[i]->posy) {
|
||||
windows[i]->close_req = 1;
|
||||
} else if (windows[i]->focused == 0) {
|
||||
keyboard_set_handler(windows[i]->keyboard_dest);
|
||||
gui_raise_to_top(i);
|
||||
}
|
||||
break;
|
||||
@ -643,7 +643,6 @@ void gui_flip() {
|
||||
if (mouse_pos_x > windows[i]->iconx -16 && mouse_pos_x < windows[i]->iconx + 72 && mouse_pos_y > windows[i]->icony -16 && mouse_pos_y < windows[i]->icony + 72) {
|
||||
windows[i]->minimized = 0;
|
||||
gui_raise_to_top(i);
|
||||
keyboard_set_handler(windows[i]->keyboard_dest);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
BIN
misc/icons/text.png
Normal file
BIN
misc/icons/text.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
@ -16,3 +16,7 @@ WORK=disk0:/
|
||||
EXEC=disk0:/games/qdoom.exe
|
||||
ICON=disk0:/icons/qdoom.png
|
||||
WORK=disk0:/games/
|
||||
EXEC=disk0:/text.exe
|
||||
ICON=disk0:/icons/text.png
|
||||
WORK=disk0:/
|
||||
|
||||
|
@ -465,6 +465,7 @@ void process_char(char c) {
|
||||
}
|
||||
|
||||
void exit_callback(int wh) {
|
||||
|
||||
quinn_exit();
|
||||
exit(0);
|
||||
}
|
||||
@ -510,6 +511,7 @@ int main(int argc, char **argv) {
|
||||
close(ParentWrite);
|
||||
|
||||
execve("disk0:/shell.exe", sargv, environ);
|
||||
exit(-1);
|
||||
} else {
|
||||
close(ChildRead);
|
||||
close(ChildWrite);
|
||||
|
14
schedule.c
14
schedule.c
@ -133,8 +133,19 @@ void init_scheduler(void) {
|
||||
void sched_free_task(struct task_t *this_task) {
|
||||
int i;
|
||||
|
||||
// stop parent task from waiting
|
||||
// kill children
|
||||
struct task_t *task = first_task;
|
||||
|
||||
for (task = first_task; task != (void *)0; task = task->next_task) {
|
||||
if (task->parent_task == this_task) {
|
||||
task->timetorun = 0;
|
||||
task->state = TASK_ZOMBIE;
|
||||
task->exit_status = 127;
|
||||
task->zombie_ttl = 5;
|
||||
}
|
||||
}
|
||||
|
||||
// stop parent task from waiting
|
||||
// free stuff
|
||||
// free any userpages
|
||||
// free stack virt space
|
||||
@ -183,6 +194,7 @@ void sched_free_task(struct task_t *this_task) {
|
||||
}
|
||||
|
||||
current_task->next_task = this_task->next_task;
|
||||
|
||||
free(this_task);
|
||||
}
|
||||
|
||||
|
2
vfs.c
2
vfs.c
@ -1022,7 +1022,7 @@ int vfs_open_file_dev(struct vfs_device_t *device, char *path, int flags, int mo
|
||||
return i;
|
||||
} else {
|
||||
if (flags & O_CREAT) {
|
||||
if (minix_create_file(device, temppath) == 0) kprintf("Create File Successful\n");
|
||||
minix_create_file(device, temppath);
|
||||
info = minix_check_if_exists(device, temppath, -1);
|
||||
if (info != NULL) {
|
||||
for (i=0;i<256;i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user