]>
Commit | Line | Data |
---|---|---|
4ebee360 | 1 | diff -Nru chkconfig-1.2.24h.orig/chkconfig.c chkconfig-1.2.24h/chkconfig.c |
2 | --- chkconfig-1.2.24h.orig/chkconfig.c Wed Jul 17 20:10:55 2002 | |
3 | +++ chkconfig-1.2.24h/chkconfig.c Wed Jan 22 11:56:32 2003 | |
4 | @@ -31,6 +31,7 @@ | |
5 | #include <sys/stat.h> | |
d8fc60be | 6 | #include <unistd.h> |
d8fc60be | 7 | static char *progname; |
8 | +extern int addItem; | |
4ebee360 | 9 | struct config conf; // used by leveldb.c |
d8fc60be | 10 | |
11 | #define _(String) gettext((String)) | |
4ebee360 | 12 | @@ -94,12 +95,10 @@ |
3d7305a2 AF |
13 | if (s.type == TYPE_XINETD) return 0; |
14 | ||
4ebee360 | 15 | for (i = 0; i <= conf.maxlevel; i++) { |
d8fc60be | 16 | - if (!isConfigured(name, i)) { |
17 | if ((1 << i) & s.levels) | |
18 | doSetService(s, i, 1); | |
19 | else | |
20 | doSetService(s, i, 0); | |
21 | - } | |
22 | } | |
23 | ||
24 | return 0; | |
4ebee360 | 25 | diff -Nru chkconfig-1.2.24h.orig/leveldb.c chkconfig-1.2.24h/leveldb.c |
26 | --- chkconfig-1.2.24h.orig/leveldb.c Fri Apr 19 03:15:55 2002 | |
27 | +++ chkconfig-1.2.24h/leveldb.c Wed Jan 22 12:04:47 2003 | |
d8fc60be | 28 | @@ -11,6 +11,10 @@ |
29 | #include <stdio.h> | |
30 | #include <string.h> | |
31 | #include <unistd.h> | |
32 | +#include <sys/types.h> | |
33 | +#include <dirent.h> | |
34 | + | |
35 | +int addItem = 0; | |
36 | ||
37 | /* Changes | |
4ebee360 | 38 | 2001-12-03 - Petter Reinholdtsen <pere@hungry.com> |
39 | @@ -231,6 +235,9 @@ | |
3d7305a2 AF |
40 | char overflow; |
41 | char levelbuf[20]; | |
42 | char * english_desc = NULL; | |
d8fc60be | 43 | + DIR *dir; |
44 | + struct dirent *dirent; | |
3d7305a2 | 45 | + int i; |
d8fc60be | 46 | |
4ebee360 | 47 | sprintf(filename, "%s/%s", conf.initdir, name); |
d8fc60be | 48 | |
4ebee360 | 49 | @@ -345,6 +352,21 @@ |
d8fc60be | 50 | |
51 | serv.name = strdup(name); | |
4ebee360 | 52 | |
d8fc60be | 53 | + if (addItem) { |
4ebee360 | 54 | + strcpy(levelbuf,"/etc/rc.d/rc0.d"); |
55 | + for(i=0;i<7;i++,levelbuf[12]++) { | |
56 | + dir=opendir(levelbuf); | |
57 | + if (!dir) return 1; | |
58 | + while ((dirent=readdir(dir))) { | |
59 | + if (strlen(dirent->d_name)<4) continue; | |
60 | + if (strcmp(dirent->d_name+3,name)) continue; | |
61 | + if (*dirent->d_name=='K') serv.levels &= ~(1<<i); | |
62 | + else if (*dirent->d_name=='S') serv.levels |= 1<<i; | |
63 | + } | |
64 | + closedir(dir); | |
d8fc60be | 65 | + } |
d8fc60be | 66 | + } |
4ebee360 | 67 | + |
d8fc60be | 68 | *service = serv; |
69 | return 0; | |
4ebee360 | 70 | } |