[hfsplus-tools] Remove asinine blocks usage so we don't need clang, build with gcc, and

Adam Jackson ajax at fedoraproject.org
Wed Jun 18 17:56:44 UTC 2014


commit fbe451afc39781c82c17bce916b25fe4d1e86f5e
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Jun 18 13:56:41 2014 -0400

    Remove asinine blocks usage so we don't need clang, build with gcc, and
    
      remove ExcludeArchery to match
    - Fix FTBFS on arm due to a... fascinating interpretation of how varargs work

 hfsplus-tools-learn-to-stdarg.patch |  120 +++++++++++++++++++++++++++++++++++
 hfsplus-tools.spec                  |    3 +
 2 files changed, 123 insertions(+), 0 deletions(-)
---
diff --git a/hfsplus-tools-learn-to-stdarg.patch b/hfsplus-tools-learn-to-stdarg.patch
new file mode 100644
index 0000000..683ed7a
--- /dev/null
+++ b/hfsplus-tools-learn-to-stdarg.patch
@@ -0,0 +1,120 @@
+diff -up diskdev_cmds-540.1.linux3/fsck_hfs.tproj/utilities.c.jx diskdev_cmds-540.1.linux3/fsck_hfs.tproj/utilities.c
+--- diskdev_cmds-540.1.linux3/fsck_hfs.tproj/utilities.c.jx	2012-02-01 12:17:19.000000000 -0500
++++ diskdev_cmds-540.1.linux3/fsck_hfs.tproj/utilities.c	2014-06-18 13:44:45.125620007 -0400
+@@ -296,11 +296,8 @@ static volatile int    keep_going = 1;
+ #undef printf
+ 
+ // prototype
+-void print_to_mem(int type, const char *fmt, const char *str, va_list ap);
+-
+-#define  DO_VPRINT   1    // types for print_to_mem
+-#define  DO_STR      2
+-
++void vprint_to_mem(const char *fmt, va_list ap);
++void print_to_mem(const char *fmt, ...);
+ 
+ static void *
+ fsck_printing_thread(void *arg)
+@@ -547,8 +544,8 @@ setup_logging(void)
+ 		cur_in_mem = in_mem_log;
+ 
+ 		t = time(NULL);
+-		print_to_mem(DO_STR, "\n%s: ", cdevname ? cdevname : "UNKNOWN-DEV", NULL); 
+-		print_to_mem(DO_STR, "fsck_hfs run at %s", ctime(&t), NULL);
++		print_to_mem("\n%s: ", cdevname ? cdevname : "UNKNOWN-DEV"); 
++		print_to_mem("fsck_hfs run at %s", ctime(&t));
+ 
+ 		if (live_fsck && log_file) {
+ 		    pthread_cond_init(&mem_buf_cond, NULL);
+@@ -576,26 +573,20 @@ setup_logging(void)
+ 
+ 
+ void
+-print_to_mem(int type, const char *fmt, const char *str, va_list ap)
++vprint_to_mem(const char *fmt, va_list ap)
+ {
+     int ret;
+     size_t size_remaining;
+     va_list ap_copy;
+     
+-    if (type == DO_VPRINT) {
+-	va_copy(ap_copy, ap);
+-    }
++    va_copy(ap_copy, ap);
+     
+     if (live_fsck) {
+ 	pthread_mutex_lock(&mem_buf_lock);
+     }
+ 	
+     size_remaining = in_mem_size - (ptrdiff_t)(cur_in_mem - in_mem_log);
+-    if (type == DO_VPRINT) {
+-	ret = vsnprintf(cur_in_mem, size_remaining, fmt, ap);
+-    } else {
+-	ret = snprintf(cur_in_mem, size_remaining, fmt, str);
+-    }
++    ret = vsnprintf(cur_in_mem, size_remaining, fmt, ap);
+     if (ret > size_remaining) {
+ 	char *new_log;
+ 	size_t amt;
+@@ -619,11 +610,7 @@ print_to_mem(int type, const char *fmt,
+ 	cur_in_mem = new_log + (cur_in_mem - in_mem_log);
+ 	in_mem_log = new_log;
+ 	size_remaining = in_mem_size - (ptrdiff_t)(cur_in_mem - new_log);
+-	if (type == DO_VPRINT) {
+-	    ret = vsnprintf(cur_in_mem, size_remaining, fmt, ap_copy);
+-	} else {
+-	    ret = snprintf(cur_in_mem, size_remaining, fmt, str);
+-	}
++	ret = vsnprintf(cur_in_mem, size_remaining, fmt, ap_copy);
+ 	if (ret <= size_remaining) {
+ 	    cur_in_mem += ret;
+ 	}
+@@ -636,11 +623,18 @@ print_to_mem(int type, const char *fmt,
+ 	pthread_mutex_unlock(&mem_buf_lock);
+     }
+ done:
+-    if (type == DO_VPRINT) {
+-	va_end(ap_copy);
+-    }
++    va_end(ap_copy);
+ }
+ 
++void
++print_to_mem(const char *fmt, ...)
++{
++    va_list ap;
++
++    va_start(ap, fmt);
++    vprint_to_mem(fmt, ap);
++    va_end(ap);
++}
+ 
+ static int need_prefix=1;
+ 
+@@ -662,7 +656,7 @@ static int need_prefix=1;
+ 	LOG_PREFIX \
+ 	vfprintf(log_file, fmt, ap); \
+     } else { \
+-	print_to_mem(DO_VPRINT, fmt, NULL, ap);	\
++	vprint_to_mem(fmt, ap);	\
+     }
+ 
+ #define FLOG(fmt, str) \
+@@ -670,7 +664,7 @@ static int need_prefix=1;
+ 	LOG_PREFIX;				\
+ 	fprintf(log_file, fmt, str);		\
+     } else { \
+-	print_to_mem(DO_STR, fmt, str, NULL);	\
++	print_to_mem(fmt, str);	\
+     }
+ 
+ 
+@@ -800,7 +794,7 @@ vplog(const char *fmt, va_list ap)
+ 	LOG_PREFIX;
+ 	vfprintf(log_file, fmt, ap);
+     } else {
+-	print_to_mem(DO_VPRINT, fmt, NULL, ap);
++	vprint_to_mem(fmt, ap);
+     }
+ }
+ 
diff --git a/hfsplus-tools.spec b/hfsplus-tools.spec
index 8b1d19b..af63623 100644
--- a/hfsplus-tools.spec
+++ b/hfsplus-tools.spec
@@ -8,6 +8,7 @@ URL:            http://gentoo-wiki.com/HOWTO_hfsplus
 
 Source0: http://cavan.codon.org.uk/~mjg59/diskdev_cmds/diskdev_cmds-%{version}.tar.gz
 Patch0: hfsplus-tools-no-blocks.patch
+Patch1: hfsplus-tools-learn-to-stdarg.patch
 
 Source100:      http://www.opensource.org/licenses/apsl-2.0.txt
 
@@ -43,6 +44,7 @@ commit.
 %prep
 %setup -q -n hfsplus-mkfs-%{version} -n diskdev_cmds-%{version}
 %patch0 -p1
+%patch1 -p1
 
 # remove errant execute bits
 find . -type f -name '*.[ch]' -exec chmod -c -x {} +
@@ -90,6 +92,7 @@ ln -s fsck.hfsplus.8 fsck.hfs.8
 * Wed Jun 18 2014 Adam Jackson <ajax at redhat.com> 540.1.linux3-8
 - Remove asinine blocks usage so we don't need clang, build with gcc, and
   remove ExcludeArchery to match
+- Fix FTBFS on arm due to a... fascinating interpretation of how varargs work
 
 * Tue Jun 10 2014 Richard W.M. Jones <rjones at redhat.com> - 540.1.linux3-7
 - ExcludeArch arm because clang doesn't select the correct float ABI.


More information about the scm-commits mailing list