Ticket #2240: mc-4.7.4-copy-queue.patch
File mc-4.7.4-copy-queue.patch, 1.6 KB (added by danilo.schembri, 14 years ago) |
---|
-
mc-4.7.4/src/background.c
old new 75 75 register_task_running (FileOpContext * ctx, pid_t pid, int fd, int to_child, 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 { … … 104 119 task_list = p->next; 105 120 g_free (p->info); 106 121 g_free (p); 122 123 /* Dany: copy/move queue handling - Begin */ 124 if (prev && prev->state == Task_Stopped){ 125 prev->state = Task_Running; 126 kill (prev->pid, SIGCONT); 127 } else if (!prev || prev->state != Task_Running) 128 presume = task_list; // Dany: Save remaining task list. 129 130 while (presume){ 131 if (presume->state == Task_Stopped){ 132 presume->state = Task_Running; 133 kill (presume->pid, SIGCONT); 134 break; 135 } 136 presume = presume->next; 137 } 138 /* Dany: copy/move queue handling - End */ 139 107 140 return p->fd; 108 141 } 109 142 prev = p;