Ticket #2240: mc-4.7.0.9-copy-queue.patch
File mc-4.7.0.9-copy-queue.patch, 1.5 KB (added by danilo.schembri, 14 years ago) |
---|
-
mc-4.7.0.9/src/background.c
old new 75 75 char *info) 76 76 { 77 77 TaskList *new; 78 TaskList *p = task_list; /* Dany */ 78 79 79 80 new = g_new (TaskList, 1); 80 81 new->pid = pid; 81 82 new->info = info; 82 83 new->state = Task_Running; 84 85 /* Dany is "Danilo Schembri" <danilo.schembri@gmail.com> 86 Dany: copy/move queue handling - Begin */ 87 while (p){ 88 if (p->state == Task_Running){ 89 new->state = Task_Stopped; 90 kill (pid, SIGSTOP); 91 break; 92 } 93 p = p->next; 94 } 95 /* Dany: file copy/move queue handling - End */ 96 83 97 new->next = task_list; 84 98 new->fd = fd; 85 99 new->to_child_fd = to_child; … … 93 107 { 94 108 TaskList *p = task_list; 95 109 TaskList *prev = 0; 110 TaskList *presume = 0; /* Dany: Remaining task list. */ 96 111 97 112 while (p){ 98 113 if (p->pid == pid){ … … 102 117 task_list = p->next; 103 118 g_free (p->info); 104 119 g_free (p); 120 121 /* Dany: copy/move queue handling - Begin */ 122 if (prev && prev->state == Task_Stopped){ 123 prev->state = Task_Running; 124 kill (prev->pid, SIGCONT); 125 } else if (!prev || prev->state != Task_Running) 126 presume = task_list; // Dany: Save remaining task list. 127 128 while (presume){ 129 if (presume->state == Task_Stopped){ 130 presume->state = Task_Running; 131 kill (presume->pid, SIGCONT); 132 break; 133 } 134 presume = presume->next; 135 } 136 /* Dany: copy/move queue handling - End */ 137 105 138 return p->fd; 106 139 } 107 140 prev = p;