Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37417297
en ru br
Репозитории 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
www.altlinux.org/Changes

Группа :: Система/Настройка/Загрузка и инициализация
Пакет: chkconfig

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: chkconfig-1.2.24-alt-progname.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:55:06 2002
+++ chkconfig-1.2.24/chkconfig.c	Sat Jan 26 20:55:18 2002
@@ -11,21 +11,21 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-static char *progname;
+extern const char *__progname;
 
 #define _(String) gettext((String)) 
 
 #include "leveldb.h"
 
 static void usage(void) {
-    fprintf(stderr, _("%s version %s - Copyright (C) 1997-2000 Red Hat, Inc.\n"), progname, VERSION);
+    fprintf(stderr, _("%s version %s - Copyright (C) 1997-2000 Red Hat, Inc.\n"), __progname, VERSION);
     fprintf(stderr, _("This may be freely redistributed under the terms of "
 			"the GNU Public License.\n"));
     fprintf(stderr, "\n");
-    fprintf(stderr, _("usage:   %s --list [name]\n"), progname);
-    fprintf(stderr, _("         %s --add <name>\n"), progname);
-    fprintf(stderr, _("         %s --del <name>\n"), progname);
-    fprintf(stderr, _("         %s [--level <levels>] <name> %s)\n"), progname, "<on|off|reset>");
+    fprintf(stderr, _("usage:   %s --list [name]\n"), __progname);
+    fprintf(stderr, _("         %s --add <name>\n"), __progname);
+    fprintf(stderr, _("         %s --del <name>\n"), __progname);
+    fprintf(stderr, _("         %s [--level <levels>] <name> %s)\n"), __progname, "<on|off|reset>");
 
     exit(1);
 }
@@ -271,11 +271,6 @@
 	    { 0, 0, 0, 0, 0 } 
     };
 
-    if ((progname = strrchr(argv[0], '/')) != NULL)
-	progname++;
-    else
-	progname = argv[0];
-
     setlocale(LC_ALL, ""); 
     bindtextdomain("chkconfig","/usr/share/locale"); 
     textdomain("chkconfig"); 
@@ -291,7 +286,7 @@
     }
 
     if (version) {
-	fprintf(stdout, _("%s version %s\n"), progname, VERSION);
+	fprintf(stdout, _("%s version %s\n"), __progname, VERSION);
 	exit(0);
     }
 
diff -ur chkconfig-1.2.24~/ntsysv.c chkconfig-1.2.24/ntsysv.c
--- chkconfig-1.2.24~/ntsysv.c	Mon Mar  5 08:51:54 2001
+++ chkconfig-1.2.24/ntsysv.c	Sat Jan 26 20:56:27 2002
@@ -16,6 +16,8 @@
 
 #include "leveldb.h"
 
+extern const char *__progname;
+
 /* return 1 on cancel, 2 on error, 0 on success */
 static int servicesWindow(struct service * services, int numServices,
 			  int levels, int backButton) {
@@ -243,7 +245,6 @@
     int numServices;
     int levels = -1;
     char * levelsStr = NULL;
-    char *progName;
     poptContext optCon;
     int rc, backButton = 0, hide = 0;
     struct poptOption optionsTable[] = {
@@ -257,14 +258,12 @@
     bindtextdomain("chkconfig", "/usr/share/locale"); 
     textdomain("chkconfig"); 
 
-    progName = argv[0];
-
     if (getuid() != 0) {
-	fprintf(stderr, _("You must be root to run %s.\n"),progName);
+	fprintf(stderr, _("You must be root to run %s.\n"), __progname);
 	exit(1);
     }
     
-    optCon = poptGetContext(progName, argc, argv, optionsTable, 0);
+    optCon = poptGetContext(__progname, argc, argv, optionsTable, 0);
     poptReadDefaultConfig(optCon, 1);
 
     if ((rc = poptGetNextOpt(optCon)) < -1) {
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin