plymouth on ppc patch

Adrian Reber adrian at lisas.de
Sat Dec 25 18:30:38 EST 2010


To build plymouth (plymouth-0.8.4-0.20101119.2) on ppc I had to create
following patch. Before sending it to the maintainer I wanted to present
it here to make sure it is the correct way to fix it.

PAGE_SIZE seems to be not defined on ppc and following patch fixes
building plymouth:

@@ -46,7 +46,7 @@
 #include <time.h>
 #include <linux/fs.h>
 #include <linux/vt.h>
-
+#include <unistd.h>
 #include <dlfcn.h>

 #include "ply-logger.h"
@@ -971,6 +971,7 @@
   char *command_line;
   ssize_t bytes_read;
   int fd;
+  int ps;
   ssize_t i;

   path = NULL;
@@ -986,8 +987,9 @@
       goto error;
     }

-  command_line = calloc (PAGE_SIZE, sizeof (char));
-  bytes_read = read (fd, command_line, PAGE_SIZE - 1);
+  ps = getpagesize();
+  command_line = calloc (ps, sizeof (char));
+  bytes_read = read (fd, command_line, ps - 1);
   if (bytes_read < 0)
     {
       ply_trace ("Could not read %s: %m", path);

Is that the correct way to solve it?

		Adrian



More information about the Fedora-ppc mailing list