Репозитории ALT
S: | 1.3.59-alt4 |
5.1: | 1.3.29-alt2 |
4.1: | 1.3.29-alt2 |
4.0: | 1.3.29-alt2 |
3.0: | 1.2.24-alt5 |
+backports: | 1.3.29-alt0.M30.1 |
Группа :: Система/Настройка/Загрузка и инициализация
Пакет: chkconfig
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: chkconfig-1.2.24-alt-cleanService.patch
Скачать
Скачать
diff -ur chkconfig-1.2.24~/chkconfig.c chkconfig-1.2.24/chkconfig.c
--- chkconfig-1.2.24~/chkconfig.c Sat Jan 26 20:28:29 2002
+++ chkconfig-1.2.24/chkconfig.c Sat Jan 26 20:37:13 2002
@@ -41,9 +41,24 @@
exit(1);
}
+static void
+cleanService(char *name) {
+ int level;
+
+ for (level = 0; level < 7; level++) {
+ glob_t globres;
+ globres.gl_pathc = 0;
+ if (!findServiceEntries(name, level, &globres) && globres.gl_pathc) {
+ int i;
+ for (i = 0; i < globres.gl_pathc; ++i)
+ unlink(globres.gl_pathv[i]);
+ globfree(&globres);
+ }
+ }
+}
+
static int delService(char * name) {
- int level, i, rc;
- glob_t globres;
+ int rc;
struct service s;
if (getuid()) {
@@ -61,13 +76,8 @@
return 0;
}
- for (level = 0; level < 7; level++) {
- if (!findServiceEntries(name, level, &globres)) {
- for (i = 0; i < globres.gl_pathc; i++)
- unlink(globres.gl_pathv[i]);
- if (globres.gl_pathc) globfree(&globres);
- }
- }
+ cleanService(name);
+
return 0;
}
@@ -91,6 +101,8 @@
return 0;
}
+ cleanService(name);
+
for (i = 0; i < 7; i++) {
if (!isConfigured(name, i)) {
if ((1 << i) & s.levels)