rpms/upstart/devel upstart-nih-alloc.patch, NONE, 1.1 upstart.spec, 1.42, 1.43

Dennis Gilmore ausil at fedoraproject.org
Sun Jan 17 21:22:11 UTC 2010


Author: ausil

Update of /cvs/pkgs/rpms/upstart/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9105

Modified Files:
	upstart.spec 
Added Files:
	upstart-nih-alloc.patch 
Log Message:
add patch from upstream for sparc alignment fixes


upstart-nih-alloc.patch:
 alloc.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

--- NEW FILE upstart-nih-alloc.patch ---
--- upstart-0.6.3/nih/alloc.c.orig	2010-01-17 17:28:33.000000000 +0000
+++ upstart-0.6.3/nih/alloc.c	2010-01-17 17:28:38.000000000 +0000
@@ -54,6 +54,8 @@
 	NihDestructor destructor;
 } NihAllocCtx;
 
+#define NIH_ALLOC_CTX_SIZE (sizeof(NihAllocCtx) + __alignof__(NihAllocCtx))
+
 /**
  * NihAllocRef:
  * @children_entry: list head in parent's children list,
@@ -82,7 +84,7 @@
  *
  * Returns: pointer to NihAllocCtx structure.
  **/
-#define NIH_ALLOC_CTX(ptr) ((NihAllocCtx *)(ptr) - 1)
+#define NIH_ALLOC_CTX(ptr) ((NihAllocCtx *)((void*)ptr - NIH_ALLOC_CTX_SIZE))
 
 /**
  * NIH_ALLOC_PTR:
@@ -93,7 +95,7 @@
  *
  * Returns: pointer to block of memory.
  **/
-#define NIH_ALLOC_PTR(ctx) ((void *)((NihAllocCtx *)(ctx) + 1))
+#define NIH_ALLOC_PTR(ctx) ((void*)((void*)ctx + NIH_ALLOC_CTX_SIZE))
 
 /**
  * NIH_ALLOC_FINALISED:
@@ -145,7 +147,7 @@
 {
 	NihAllocCtx *ctx;
 
-	ctx = __nih_malloc (sizeof (NihAllocCtx) + size);
+	ctx = __nih_malloc (NIH_ALLOC_CTX_SIZE + size);
 	if (! ctx)
 		return NULL;
 
@@ -230,7 +232,7 @@
 	/* Now do the actual realloc(), if this fails then we can just
 	 * return NULL since we've not actually changed anything.
 	 */
-	ctx = __nih_realloc (ctx, sizeof (NihAllocCtx) + size);
+	ctx = __nih_realloc (ctx, NIH_ALLOC_CTX_SIZE + size);
 	if (! ctx)
 		return NULL;
 
@@ -562,7 +564,7 @@
 	nih_assert (child != NULL);
 	nih_assert (child->destructor != NIH_ALLOC_FINALISED);
 
-	ref = NIH_MUST (malloc (sizeof (NihAllocRef)));
+	ref = NIH_MUST (malloc (NIH_ALLOC_CTX_SIZE));
 
 	nih_list_init (&ref->children_entry);
 	nih_list_init (&ref->parents_entry);
@@ -739,5 +741,5 @@
 	ctx = NIH_ALLOC_CTX (ptr);
 	nih_assert (ctx->destructor != NIH_ALLOC_FINALISED);
 
-	return malloc_usable_size (ctx) - sizeof (NihAllocCtx);
+	return malloc_usable_size (ctx) - NIH_ALLOC_CTX_SIZE;
 }


Index: upstart.spec
===================================================================
RCS file: /cvs/pkgs/rpms/upstart/devel/upstart.spec,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -p -r1.42 -r1.43
--- upstart.spec	11 Jan 2010 20:44:57 -0000	1.42
+++ upstart.spec	17 Jan 2010 21:22:11 -0000	1.43
@@ -1,6 +1,6 @@
 Name:           upstart
 Version:        0.6.3
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        An event-driven init system
 
 Group:          System Environment/Base
@@ -11,6 +11,9 @@ Source0:        http://upstart.ubuntu.co
 Patch0:         upstart-remove-tests.patch
 Patch1:		upstart-telinit.patch
 Patch2:		upstart-audit-events.patch
+# pulled from https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/436758 
+# sparc specific allignment errors
+Patch3:         upstart-nih-alloc.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes: SysVinit < 2.86-24, sysvinit < 2.86-24
 Provides: SysVinit = 2.86-24, sysvinit = 2.86-24
@@ -27,6 +30,7 @@ during shutdown and supervising them whi
 %patch0 -p1 -b .tests
 %patch1 -p1 -b .u
 %patch2 -p1 -b .audit
+%patch3 -p1 -b .alignment
 
 %build
 %configure --sbindir=/sbin --libdir=/%{_lib}
@@ -105,6 +109,9 @@ rm -rf %{buildroot}
 %{_mandir}/man8/telinit.8.gz
 
 %changelog
+* Sun Jan 17 2010 Dennis Gilmore <dennis at ausil.us> - 0.6.3-6
+- add patch from upstream fixing sparc alignment issues
+
 * Mon Jan 11 2010 Petr Lautrbach <plautrba at redhat.com> 0.6.3-5
 - License changed to GPLv2 and LGPLv2+
 



More information about the scm-commits mailing list