[sheepdog] [PATCH 1/4] logger: use ARG_MAX for limit of command line length

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Feb 27 18:15:35 CET 2013


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 lib/logger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/logger.c b/lib/logger.c
index 57e0a09..0dd9422 100644
--- a/lib/logger.c
+++ b/lib/logger.c
@@ -33,6 +33,7 @@
 #include <libgen.h>
 #include <sys/time.h>
 #include <execinfo.h>
+#include <linux/limits.h>
 
 #include "logger.h"
 #include "util.h"
@@ -635,8 +636,7 @@ notrace void sd_backtrace(void)
 
 	for (i = 1; i < n; i++) { /* addrs[0] is here, so skip it */
 		void *addr = addrs[i];
-		char cmd[PATH_MAX], path[PATH_MAX] = {0}, info[256] = {0},
-		     **str;
+		char cmd[ARG_MAX], path[PATH_MAX] = {0}, info[256], **str;
 		FILE *f;
 
 		/* the called function is at the previous address
-- 
1.8.1.3.566.gaa39828




More information about the sheepdog mailing list