Hello,

On Sun, Jul 19, 2009 at 7:39 AM, Otavio Salvador<[email protected]> wrote:
> build/fdasd: avoid compilation failure on s390

I've done it, please review it again so I can push it.

-- 
Otavio Salvador                  O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br
From 302517d3ecdda2a1c11218232cde307ae7b6fad8 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <[email protected]>
Date: Sun, 19 Jul 2009 09:03:59 -0300
Subject: [PATCH] build/fdasd: avoid compilation failure on s390

To export LinuxSpecific stuff for labels, in this case fdasd, we now
provide arch/linux.h file that has the required code. This allows to
us to avoid duplicating code to refer to it while to not make it
exposed to public usage to avoid dependency on this.
---
 libparted/Makefile.am        |    5 +++++
 libparted/arch/linux.c       |   19 +------------------
 libparted/labels/Makefile.am |    4 ++--
 libparted/labels/fdasd.c     |    1 +
 4 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/libparted/Makefile.am b/libparted/Makefile.am
index c46cbd1..13a0c7d 100644
--- a/libparted/Makefile.am
+++ b/libparted/Makefile.am
@@ -32,7 +32,12 @@ libparted_la_SOURCES  = debug.c			\
 			arch/blkpg.h		\
 			arch/$(OS).c
 
+ifeq ($(OS), linux)
+libparted_la_SOURCES += arch/$(OS).h
+endif
+
 EXTRA_libparted_la_SOURCES    = arch/linux.c		\
+				arch/linux.h	\
 				arch/gnu.c \
 				arch/beos.c
 
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 66fdd37..8f220e0 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -18,6 +18,7 @@
 #define PROC_DEVICES_BUFSIZ 16384
 
 #include <config.h>
+#include <arch/linux.h>
 
 #include <parted/parted.h>
 #include <parted/debug.h>
@@ -75,24 +76,6 @@
 #define RW_MODE (O_RDWR)
 #endif
 
-#if defined(__s390__) || defined(__s390x__)
-#  include <parted/fdasd.h>
-#endif
-
-#define LINUX_SPECIFIC(dev)	((LinuxSpecific*) (dev)->arch_specific)
-
-typedef	struct _LinuxSpecific	LinuxSpecific;
-
-struct _LinuxSpecific {
-	int	fd;
-	char*	dmtype;         /**< device map target type */
-#if defined(__s390__) || defined(__s390x__)
-	unsigned int real_sector_size;
-	/* IBM internal dasd structure (i guess ;), required. */
-	struct fdasd_anchor *anchor;
-#endif
-};
-
 struct hd_geometry {
         unsigned char heads;
         unsigned char sectors;
diff --git a/libparted/labels/Makefile.am b/libparted/labels/Makefile.am
index d4fe198..6bbe2bf 100644
--- a/libparted/labels/Makefile.am
+++ b/libparted/labels/Makefile.am
@@ -1,5 +1,5 @@
 # This file is part of GNU Parted
-# Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2007, 2009 Free Software Foundation, Inc.
 #
 # This file may be modified and/or distributed without restriction.
 
@@ -9,7 +9,7 @@ else
 S390_SRCS =
 endif
 
-partedincludedir      =	-I$(top_srcdir)/lib -I$(top_srcdir)/include
+partedincludedir      =	-I$(top_srcdir)/lib -I$(top_srcdir)/include -I$(top_srcdir)/libparted
 noinst_LTLIBRARIES    =	liblabels.la
 
 liblabels_la_SOURCES = \
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
index 40ba8c9..e0ffe2e 100644
--- a/libparted/labels/fdasd.c
+++ b/libparted/labels/fdasd.c
@@ -17,6 +17,7 @@
  */
 
 #include <config.h>
+#include <arch/linux.h>
 #include <parted/vtoc.h>
 #include <parted/fdasd.h>
 
-- 
1.6.3.3.385.g60647

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to