Patchwork [U-Boot,RFC,3/3] tools/env: Bump devname length to PATH_MAX for filenames

login
register
mail settings
Submitter Steve Sakoman
Date Dec. 4, 2010, 4:28 a.m.
Message ID <1291436933-26861-4-git-send-email-steve@sakoman.com>
Download mbox | patch
Permalink /patch/74247/
State Changes Requested
Headers show

Comments

Steve Sakoman - Dec. 4, 2010, 4:28 a.m.
From: Loïc Minier <loic.minier@linaro.org>

This patch increases the devname length to 4096 in order to support writing
to normal files in addition to mtd devices.

Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Tested-by: Steve Sakoman <steve.sakoman@linaro.org>
---
 tools/env/fw_env.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Patch

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index d2f9748..a75b73b 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -53,8 +53,12 @@ 
 	(void) (&_min1 == &_min2);		\
 	_min1 < _min2 ? _min1 : _min2; })
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 struct envdev_s {
-	char devname[16];		/* Device name */
+	char devname[PATH_MAX];		/* Device name */
 	ulong devoff;			/* Device offset */
 	ulong env_size;			/* environment size */
 	ulong erase_size;		/* device erase size */