[oe-commits] org.oe.dev parted/parted-1.8.0/memory_allocation.patch : Addition of patch

kristoffer commit openembedded-commits at lists.openembedded.org
Thu Jan 11 18:49:33 UTC 2007


parted/parted-1.8.0/memory_allocation.patch : Addition of patch
* Parted doesnt work on ARM when used with glibc 2.5
  This patch although not fixing the issue adds
  some cleanups. Supplied by maintainers.

Author: kristoffer at openembedded.org
Branch: org.openembedded.dev
Revision: c4bca390acd8e11f41e5c2fa6f21837f7f6b70ae
ViewMTN: http://monotone.openembedded.org/revision.psp?id=c4bca390acd8e11f41e5c2fa6f21837f7f6b70ae
Files:
1
packages/parted/parted-1.8.0
packages/parted/parted-1.8.0/memory_allocation.patch
Diffs:

#
# mt diff -r17ce0a15a8bf58dbe4b4b3d92ba51d210f2b7407 -rc4bca390acd8e11f41e5c2fa6f21837f7f6b70ae
#
# 
# 
# add_dir "packages/parted/parted-1.8.0"
# 
# add_file "packages/parted/parted-1.8.0/memory_allocation.patch"
#  content [5a011ba90333895d39fb44b05cb8838761ec893d]
# 
============================================================
--- packages/parted/parted-1.8.0/memory_allocation.patch	5a011ba90333895d39fb44b05cb8838761ec893d
+++ packages/parted/parted-1.8.0/memory_allocation.patch	5a011ba90333895d39fb44b05cb8838761ec893d
@@ -0,0 +1,42 @@
+--- parted-1.8.0/libparted/exception.c_orig	2006-12-11 19:44:23.000000000 +0000
++++ parted-1.8.0/libparted/exception.c	2006-12-11 19:47:53.000000000 +0000
+@@ -231,6 +231,9 @@
+ 		     PedExceptionOption ex_opts, const char* message, ...)
+ {
+ 	va_list		arg_list;
++        int result;
++	static int size = 1000;
++
+ 
+ 	if (ex)
+ 		ped_exception_catch ();
+@@ -239,16 +242,22 @@
+ 	if (!ex)
+ 		goto no_memory;
+ 
+-	ex->message = (char*) malloc (8192);
+-	if (!ex->message)
+-		goto no_memory;
+-
+ 	ex->type = ex_type;
+ 	ex->options = ex_opts;
+ 
+-	va_start (arg_list, message);
+-	vsnprintf (ex->message, 8192, message, arg_list);
+-	va_end (arg_list);
++        while (1) {
++	            ex->message = (char*) malloc (size);
++		    if (!ex->message)
++		              goto no_memory;
++		    va_start (arg_list, message);
++		    result = vsnprintf (ex->message, size, message, arg_list);
++		    va_end (arg_list);
++		    
++		    if (result > -1 && result < size)
++		                    break;
++		    size += 10;
++		  }
++	            
+ 
+ 	return do_throw ();
+ 






More information about the Openembedded-commits mailing list