From: Ray Strode Date: Mon, 28 Feb 2011 18:01:39 +0000 (-0500) Subject: utils: don't depend on PAGE_SIZE X-Git-Tag: 0.8.4~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6b10b1cbcf9f7d42a3c4b73dadbd645deca7a62;p=thirdparty%2Fplymouth.git utils: don't depend on PAGE_SIZE It's not defined for all architectures. We don't really need the page size anyway, we just need a reasonably large value. --- diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c index 5b06e493..6ae280eb 100644 --- a/src/libply/ply-utils.c +++ b/src/libply/ply-utils.c @@ -71,6 +71,10 @@ #define PLY_ENABLE_CONSOLE_PRINTK 7 #endif +#ifndef PLY_MAX_COMMAND_LINE_SIZE +#define PLY_MAX_COMMAND_LINE_SIZE 4096 +#endif + static int errno_stack[PLY_ERRNO_STACK_SIZE]; static int errno_stack_position = 0; @@ -986,8 +990,8 @@ ply_get_process_command_line (pid_t pid) goto error; } - command_line = calloc (PAGE_SIZE, sizeof (char)); - bytes_read = read (fd, command_line, PAGE_SIZE - 1); + command_line = calloc (PLY_MAX_COMMAND_LINE_SIZE, sizeof (char)); + bytes_read = read (fd, command_line, PLY_MAX_COMMAND_LINE_SIZE - 1); if (bytes_read < 0) { ply_trace ("Could not read %s: %m", path);