celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ferry Huberts <maili...@hupie.com>
Subject [RFC] [PATCH v1 7/9] MAXNAMLEN is actually called NAME_MAX
Date Fri, 13 Jul 2012 21:35:50 GMT
From: Ferry Huberts <ferry.huberts@pelagic.nl>

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
---
 deployment_admin/private/src/deployment_admin.c |    6 ++++--
 shell/update_command.c                          |    4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/deployment_admin/private/src/deployment_admin.c b/deployment_admin/private/src/deployment_admin.c
index 5065b5f..de0333f 100644
--- a/deployment_admin/private/src/deployment_admin.c
+++ b/deployment_admin/private/src/deployment_admin.c
@@ -12,6 +12,8 @@
 #include <curl/easy.h>
 #include <apr_strings.h>
 
+#include <linux/limits.h>
+
 #include "deployment_admin.h"
 #include "celix_errno.h"
 #include "bundle_context.h"
@@ -115,13 +117,13 @@ static void *APR_THREAD_FUNC deploymentAdmin_poll(apr_thread_t *thd,
void *deplo
 					request = apr_pstrcat(admin->pool, admin->pollUrl, "/", last, NULL);
 				}
 
-				char inputFile[MAXNAMLEN];
+				char inputFile[NAME_MAX];
 				inputFile[0] = '\0';
 				char *test = inputFile;
 				celix_status_t status = deploymentAdmin_download(request, &test);
 				if (status == CELIX_SUCCESS) {
 					// Handle file
-					char tmpDir[MAXNAMLEN];
+					char tmpDir[NAME_MAX];
 					tmpDir[0] = '\0';
 					tmpnam(tmpDir);
 
diff --git a/shell/update_command.c b/shell/update_command.c
index aab412e..62c455d 100644
--- a/shell/update_command.c
+++ b/shell/update_command.c
@@ -28,6 +28,8 @@
 #include <curl/curl.h>
 #include <curl/easy.h>
 
+#include <linux/limits.h>
+
 #include "command_private.h"
 #include "array_list.h"
 #include "bundle_context.h"
@@ -65,7 +67,7 @@ void updateCommand_execute(COMMAND command, char * line, void (*out)(char
*), vo
 		bundleContext_getBundleById(command->bundleContext, id, &bundle);
 		if (bundle != NULL) {
 			sub = strtok(NULL, delims);
-			char inputFile[MAXNAMLEN];
+			char inputFile[NAME_MAX];
 			inputFile[0] = '\0';
 			if (sub != NULL) {
 				printf("URL: %s\n", sub);
-- 
1.7.10.4


Mime
View raw message