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)