Ticket #2240: mc-4.7.0_pre3-copy-queue.patch

File mc-4.7.0_pre3-copy-queue.patch, 1.5 KB (added by danilo.schembri, 15 years ago)
Line 
1Patch by Danilo Schembri <danilo.schembri@gmail.com>
2
3*** mc-4.7.0-pre3/src/background.c      Thu Sep 24 11:46:42 2009
4--- mc-4.7.0-pre3/src/background.c      Sat Dec  5 21:57:01 2009
5***************
6*** 76,81 ****
7--- 76,95 ----
8      new->pid   = pid;
9      new->info  = info;
10      new->state = Task_Running;
11+
12+ // Dany: copy/move queue handling - Begin
13+ // Dany is "Danilo Schembri" <danilo.schembri@gmail.com>
14+     TaskList *p = task_list;
15+     while (p){
16+       if (p->state == Task_Running){
17+           kill (pid, SIGSTOP);
18+           new->state = Task_Stopped;
19+           break;
20+       }
21+       p = p->next;
22+     }
23+ // Dany: file copy/move queue handling - End
24+
25      new->next  = task_list;
26      new->fd    = fd;
27      task_list  = new;
28***************
29*** 88,93 ****
30--- 102,108 ----
31  {
32      TaskList *p = task_list;
33      TaskList *prev = 0;
34+     TaskList *presume = 0; // Dany: Remaining task list.
35 
36      while (p){
37        if (p->pid == pid){
38***************
39*** 103,108 ****
40--- 118,141 ----
41        p = p->next;
42      }
43      delete_select_channel (fd);
44+
45+ // Dany: copy/move queue handling - Begin
46+     if (prev && prev->state == Task_Stopped){
47+       kill (prev->pid, SIGCONT);
48+       prev->state = Task_Running;
49+     } else
50+       presume = task_list; // Dany: Save remaining task list.
51+
52+     while (presume){
53+       if (presume->state == Task_Stopped){
54+           kill (presume->pid, SIGCONT);
55+           presume->state = Task_Running;
56+           break;
57+       }
58+       presume = presume->next;
59+     }
60+ // Dany: copy/move queue handling - End
61+
62  }
63 
64  /*