Hi,

attached a small patch to silence some warnings with genpart-1.0.1. As
gcc is handling such warnings as errors now (Ubuntu 8.10), it caused a
build break.

-- 
Carsten Schlote <[EMAIL PROTECTED]>
konzeptpark.de
commit 7a326c2cd0671eed6a3e4ce79beed12b6064de1f
Author: Carsten Schlote <[EMAIL PROTECTED](none)>
Date:   Thu Nov 6 17:00:08 2008 +0100

    [genpart-1.0.1] Fix compiler warnings
    
    Fix some warnings, which are handled as error by gcc. Can't hurt to
    fix the code.
    
    ---
     platform-AvantechUNO/build-host/genpart-1.0.1/src/genpart.c |   14 
++++++-----
     1 file changed, 8 insertions(+), 6 deletions(-)
    
    Signed-off-by: Carsten Schlote <[EMAIL PROTECTED](none)>

diff --git a/patches/genpart-1.0.1/generic/fix-compiler-warning.patch 
b/patches/genpart-1.0.1/generic/fix-compiler-warning.patch
new file mode 100644
index 0000000..ae4ccb1
--- /dev/null
+++ b/patches/genpart-1.0.1/generic/fix-compiler-warning.patch
@@ -0,0 +1,30 @@
+Index: genpart-1.0.1/src/genpart.c
+===================================================================
+--- genpart-1.0.1.orig/src/genpart.c   2006-12-07 12:54:07.000000000 +0100
++++ genpart-1.0.1/src/genpart.c        2008-11-06 16:59:48.000000000 +0100
+@@ -40,6 +40,7 @@
+       struct partition_entry entry;
+       int opt, do_magic = 0;
+       unsigned short magic = 0xaa55;
++      int rc = 10;
+ 
+       struct option long_options[] = {
+               { "help", no_argument, 0, 'h' },
+@@ -87,10 +88,11 @@
+               }
+       }
+ 
+-      fwrite(&entry, sizeof(struct partition_entry), 1, stdout);
+-
+-      if(do_magic)
+-              fwrite(&magic, 2, 1, stdout);
+-
+-      return 0;
++      if(fwrite(&entry, sizeof(struct partition_entry), 1, stdout)>0) {
++              if(do_magic) {
++                      if(fwrite(&magic, 2, 1, stdout)>0)
++                              rc=0;
++              }
++      }
++      return rc;
+ }
diff --git a/patches/genpart-1.0.1/generic/series 
b/patches/genpart-1.0.1/generic/series
new file mode 100644
index 0000000..d24b275
--- /dev/null
+++ b/patches/genpart-1.0.1/generic/series
@@ -0,0 +1 @@
+fix-compiler-warning.patch
--
ptxdist mailing list
[email protected]

Reply via email to