]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
utils: don't depend on PAGE_SIZE
authorRay Strode <rstrode@redhat.com>
Mon, 28 Feb 2011 18:01:39 +0000 (13:01 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 28 Feb 2011 18:01:39 +0000 (13:01 -0500)
It's not defined for all architectures.

We don't really need the page size anyway, we just need a reasonably
large value.

src/libply/ply-utils.c

index 5b06e4939829d2b53484337aafefc38997a79fea..6ae280ebdc22b129dd818c88139ebac3eca813b5 100644 (file)
 #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);