summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-10-31 13:05:47 +0100
committerSteven Barth <steven@midlink.org>2014-10-31 13:05:47 +0100
commitf83a9e2f677df368ff3a6deea5aaeca7f28cd46e (patch)
treed979081eb9640f473a79534cf91f8d031eeebd11 /utils
parent07c7864d49723b1264ee8bcd6861ea92f679ee98 (diff)
downloadunitd-f83a9e2f677df368ff3a6deea5aaeca7f28cd46e.tar
unitd-f83a9e2f677df368ff3a6deea5aaeca7f28cd46e.zip
Fix regression in command line parsing
79872ea6 reduced the command line buffer breaking various platforms. Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.c6
-rw-r--r--utils/utils.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/utils/utils.c b/utils/utils.c
index a8c2a91..e782e44 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -129,8 +129,8 @@ blobmsg_list_equal(struct blobmsg_list *l1, struct blobmsg_list *l2)
char* get_cmdline_val(const char* name, char* out, int len)
{
- char pattern[COMMAND_LINE_SIZE + 1];
- char line[COMMAND_LINE_SIZE + 1];
+ char pattern[CMDLINE_SIZE + 1];
+ char line[CMDLINE_SIZE + 1];
char *res = NULL, *tty;
int r, fd;
regex_t pat_cmdline;
@@ -140,7 +140,7 @@ char* get_cmdline_val(const char* name, char* out, int len)
if (fd < 0)
return NULL;
- r = read(fd, line, COMMAND_LINE_SIZE);
+ r = read(fd, line, CMDLINE_SIZE);
if ( r <= 0 ) {
close(fd);
return NULL;
diff --git a/utils/utils.h b/utils/utils.h
index c2c1cb4..8b384fc 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -19,6 +19,8 @@
#include <libubox/blob.h>
#include <libubox/blobmsg.h>
+#define CMDLINE_SIZE 2048
+
struct blobmsg_list_node {
struct avl_node avl;
struct blob_attr *data;