[BusyBox-cvs] busybox/debianutils Config.in, 1.3, 1.4 Makefile.in, 1.2, 1.3 run_parts.c, 1.4, 1.5

Erik Andersen andersen at busybox.net
Sat Jul 26 09:16:04 UTC 2003


Update of /var/cvs/busybox/debianutils
In directory winder:/tmp/cvs-serv10740/debianutils

Modified Files:
	Config.in Makefile.in run_parts.c 
Log Message:
Move start_stop_daemon to debianutils.
Cleanup run_parts a bit and add long opts


Index: Config.in
===================================================================
RCS file: /var/cvs/busybox/debianutils/Config.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Config.in	5 Jul 2003 07:52:31 -0000	1.3
+++ Config.in	26 Jul 2003 09:16:00 -0000	1.4
@@ -33,6 +33,14 @@
 	  Unless you know that run-parts is used in some of your scripts
 	  you can safely say N here.
 
+config CONFIG_START_STOP_DAEMON
+	bool "start-stop-daemon"
+	default y
+	help
+	  start-stop-daemon is used to control the creation and
+	  termination of system-level processes, usually the ones
+	  started during the startup of the system.
+
 config CONFIG_WHICH
 	bool "which"
 	default n

Index: Makefile.in
===================================================================
RCS file: /var/cvs/busybox/debianutils/Makefile.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile.in	14 Jul 2003 21:20:47 -0000	1.2
+++ Makefile.in	26 Jul 2003 09:16:00 -0000	1.3
@@ -27,6 +27,7 @@
 DEBIANUTILS-$(CONFIG_MKTEMP)		+= mktemp.o
 DEBIANUTILS-$(CONFIG_READLINK)		+= readlink.o
 DEBIANUTILS-$(CONFIG_RUN_PARTS)		+= run_parts.o
+DEBIANUTILS-$(CONFIG_START_STOP_DAEMON)	+= start_stop_daemon.o
 DEBIANUTILS-$(CONFIG_WHICH)		+= which.o
 
 libraries-y+=$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR)

Index: run_parts.c
===================================================================
RCS file: /var/cvs/busybox/debianutils/run_parts.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- run_parts.c	19 Mar 2003 09:11:41 -0000	1.4
+++ run_parts.c	26 Jul 2003 09:16:00 -0000	1.5
@@ -54,6 +54,13 @@
 
 #include "libbb.h"
 
+static const struct option runparts_long_options[] = {
+	{ "test",		0,		NULL,		't' },
+	{ "umask",		1,		NULL,		'u' },
+	{ "arg",		1,		NULL,		'a' },
+	{ 0,			0,		0,			0 }
+};
+
 /* run_parts_main */
 /* Process options */
 int run_parts_main(int argc, char **argv)
@@ -65,32 +72,31 @@
 
 	umask(022);
 
-	while ((opt = getopt(argc, argv, "tu:a:")) != -1) {
+	while ((opt = getopt_long (argc, argv, "tu:a:",
+					runparts_long_options, NULL)) > 0)
+	{
 		switch (opt) {
-		case 't':		/* Enable test mode */
-			test_mode = 1;
-			break;
-		case 'u':		/* Set the umask of the programs executed */
-			/* Check and set the umask of the program executed. As stated in the original
-			 * run-parts, the octal conversion in libc is not foolproof; it will take the 
-			 * 8 and 9 digits under some circumstances. We'll just have to live with it.
-			 */
-			{
-				const unsigned int mask = (unsigned int) strtol(optarg, NULL, 8);
-				if (mask > 07777) {
-					bb_perror_msg_and_die("bad umask value");
-				}
-				umask(mask);
-			}
-			break;
-		case 'a':		/* Pass an argument to the programs */
-			/* Add an argument to the commands that we will call.
-			 * Called once for every argument. */
-			args = xrealloc(args, (argcount + 2) * (sizeof(char *)));
-			args[argcount++] = optarg;
-			break;
-		default:
-			bb_show_usage();
+			/* Enable test mode */
+			case 't':
+				test_mode++;
+				break;
+			/* Set the umask of the programs executed */
+			case 'u':
+				/* Check and set the umask of the program executed. As stated in the original
+				 * run-parts, the octal conversion in libc is not foolproof; it will take the 
+				 * 8 and 9 digits under some circumstances. We'll just have to live with it.
+				 */
+				umask(bb_xgetlarg(optarg, 8, 0, 07777));
+				break;
+			/* Pass an argument to the programs */
+			case 'a':
+				/* Add an argument to the commands that we will call.
+				 * Called once for every argument. */
+				args = xrealloc(args, (argcount + 2) * (sizeof(char *)));
+				args[argcount++] = optarg;
+				break;
+			default:
+				bb_show_usage();
 		}
 	}
 




More information about the busybox-cvs mailing list