svn commit: trunk/busybox: findutils include libbb

vda at busybox.net vda at busybox.net
Sat Jan 27 13:45:18 UTC 2007


Author: vda
Date: 2007-01-27 05:45:17 -0800 (Sat, 27 Jan 2007)
New Revision: 17552

Log:
fix warning in find.c


Modified:
   trunk/busybox/findutils/find.c
   trunk/busybox/include/libbb.h
   trunk/busybox/libbb/xfuncs.c


Changeset:
Modified: trunk/busybox/findutils/find.c
===================================================================
--- trunk/busybox/findutils/find.c	2007-01-27 13:44:53 UTC (rev 17551)
+++ trunk/busybox/findutils/find.c	2007-01-27 13:45:17 UTC (rev 17552)
@@ -59,7 +59,7 @@
 #define ACTS(name, arg...) typedef struct { action a; arg; } action_##name;
 #define ACTF(name)         static int func_##name(const char *fileName, struct stat *statbuf, action_##name* ap)
                         ACTS(print)
-                        ACTS(name,  char *pattern;)
+                        ACTS(name,  const char *pattern;)
 USE_FEATURE_FIND_PRINT0(ACTS(print0))
 USE_FEATURE_FIND_TYPE(  ACTS(type,  int type_mask;))
 USE_FEATURE_FIND_PERM(  ACTS(perm,  char perm_char; mode_t perm_mask;))
@@ -273,7 +273,7 @@
 
 
 #if ENABLE_FEATURE_FIND_TYPE
-static int find_type(char *type)
+static int find_type(const char *type)
 {
 	int mask = 0;
 
@@ -349,8 +349,8 @@
 // We implement: (), -a, -o
 
 	while (*argv) {
-		char *arg = argv[0];
-		char *arg1 = argv[1];
+		const char *arg = argv[0];
+		const char *arg1 = argv[1];
 	/* --- Operators --- */
 		if (strcmp(arg, "-a") == 0
 		    USE_DESKTOP(|| strcmp(arg, "-and") == 0)

Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h	2007-01-27 13:44:53 UTC (rev 17551)
+++ trunk/busybox/include/libbb.h	2007-01-27 13:45:17 UTC (rev 17552)
@@ -259,7 +259,7 @@
 char *xgetcwd(char *cwd);
 char *xreadlink(const char *path);
 char *xmalloc_realpath(const char *path);
-extern void xstat(char *filename, struct stat *buf);
+extern void xstat(const char *filename, struct stat *buf);
 extern pid_t spawn(char **argv);
 extern pid_t xspawn(char **argv);
 extern int wait4pid(int pid);

Modified: trunk/busybox/libbb/xfuncs.c
===================================================================
--- trunk/busybox/libbb/xfuncs.c	2007-01-27 13:44:53 UTC (rev 17551)
+++ trunk/busybox/libbb/xfuncs.c	2007-01-27 13:45:17 UTC (rev 17552)
@@ -568,7 +568,7 @@
 }
 
 // xstat() - a stat() which dies on failure with meaningful error message
-void xstat(char *name, struct stat *stat_buf)
+void xstat(const char *name, struct stat *stat_buf)
 {
 	if (stat(name, stat_buf))
 		bb_perror_msg_and_die("can't stat '%s'", name);




More information about the busybox-cvs mailing list