Git init
[external/insserv.git] / packaging / 71_complete_makefile.patch
1 Purpose: Make sure the .depend.* files have complete dependencies when
2          recursive virtual facilities are used.
3 Fixes:   #534526
4 Status:  From upstream.
5 ---
6 Index: insserv/insserv.c
7 ===================================================================
8 --- insserv.orig/insserv.c      2009-09-26 22:35:39.000000000 +0200
9 +++ insserv/insserv.c   2009-09-26 22:35:42.000000000 +0200
10 @@ -2109,33 +2109,26 @@
11             goto out;
12         }
13  
14 -       if ((*deep)++ > 10) {
15 -           warn("The nested level of the system facilities in the insserv.conf file(s) is to large\n");
16 -           goto out;
17 -       }
18 -
19         list_for_each_safe(tmp, safe, ptr) {
20             repl_t * rnxt = getrepl(tmp);
21             if (*rnxt->r[0].name == '$') {
22 -               expand_faci(tmp, head, deep);
23 -           } else {
24 -               if (*deep == 1) {
25 -                   if (--(*rent->r[0].ref) <= 0)
26 -                       free(rent->r[0].ref);
27 -                   rent->r[0] = rnxt->r[0];
28 -                   ++(*rent->r[0].ref);
29 -               } else {
30 -                   repl_t *restrict subst;
31 -                   if (posix_memalign((void*)&subst, sizeof(void*), alignof(repl_t)) != 0)
32 -                       error("%s", strerror(errno));
33 -                   insert(&subst->r_list, head);
34 -                   subst->r[0] = rnxt->r[0];
35 -                   ++(*subst->r[0].ref);
36 +               if (*deep > 10) {
37 +                   warn("The nested level of the system facilities in the insserv.conf file(s) is to large\n");
38 +                   goto out;
39                 }
40 +               (*deep)++;
41 +               expand_faci(tmp, head, deep);
42 +               (*deep)--;
43 +           } else if (*deep > 0) {
44 +               repl_t *restrict subst;
45 +               if (posix_memalign((void*)&subst, sizeof(void*), alignof(repl_t)) != 0)
46 +                   error("%s", strerror(errno));
47 +               insert(&subst->r_list, head->prev);
48 +               subst->r[0] = rnxt->r[0];
49 +               (*subst->r[0].ref) = 1;
50             }
51         }
52  out:
53 -       (*deep)--;
54         return;
55  }
56