Patch: Elm ME+ 2.5 PLalpha48 -> Elm ME+ 2.5 PLalpha49 [4/9] (2/5)
From
Kari Hurtta@21:1/5 to
All on Thu Jan 3 16:42:46 2019
[continued from previous message]
zero_actions_item(&(actions[ptr]));
***************
*** 163,212 ****
actions_count--;
}
! const union action_routine_data NO_action_routine_data;
! const union schedule_routine_data NO_schedule_routine_data;
! void change_action (fd,timeout_sec,read_act,write_act,timeout_act,
! free_action_data,inc_action_data_refcount,
! data)
! int fd;
! int timeout_sec;
! action_routine * read_act;
! action_routine * write_act;
! action_routine * timeout_act;
! free_action_data_f * free_action_data;
! inc_action_data_refcount_f * inc_action_data_refcount;
! union action_routine_data data;
{
int ptr;
! struct stat ST;
! int r;
! static int report_time_MAX = 1;
! for (ptr = 0; ptr < actions_count; ptr++)
! if (actions[ptr].fd == fd)
! break;
! if (ptr == actions_count) {
! if (no_action_routine == read_act &&
! no_action_routine == write_act &&
! no_action_routine == timeout_act) {
! DPRINT(Debug,9,(&Debug,
! "change_action: action for (fd=%d) already cleared\n",
! fd));
! return;
! }
! actions = safe_array_realloc(actions, (++actions_count),
! sizeof (struct actions));
! zero_actions_item(& (actions[ptr]));
! DPRINT(Debug,4,(&Debug,
! "** Adding action %d (fd=%d)\n", ptr,fd));
! }
if (report_time_MAX) {
char * X = ctime(&time_MAX);
--- 197,345 ----
actions_count--;
}
! static void remove_action P_((int ptr));
! static void remove_action(ptr)
! int ptr;
! {
! int p = getpid();
! int badpid = 0;
!
! if (ptr < 0 || ptr >= actions_count)
! panic("SCHEDULE PANIC",__FILE__,__LINE__,
! "remove_action",
! "Bad index",0);
!
! DPRINT(Debug,4,(&Debug,
! "** Removing action %d (fd=%d)", ptr,
! actions[ptr].fd));
! if (actions[ptr].caller_pid != p) {
! DPRINT(Debug,4,(&Debug," -- caller pid %d is not our (%d)",
! actions[ptr].caller_pid,p));
! badpid = actions[ptr].caller_pid;
! }
!
! DPRINT(Debug,4,(&Debug,"\n"));
!
! remove_action0(ptr,badpid);
! }
!
! static void schedule_remove_idx P_((int ptr));
!
!
! void clear_other_actions(mypid)
! int mypid;
{
int ptr;
! int have_busy = 0;
!
! for (ptr = 0; ptr < actions_count; ptr++) {
! if (actions[ptr].busy) {
! DPRINT(Debug,12,(&Debug,
! "clear_ot