Request for review.
xfs_copy was seg faulting for me on my x86_64 box.
This fixes up the variable arg handling for multiple
vfprintf calls by putting va_start and va_end calls
around them (never done this before:).
Thanks,
--Tim
===========================================================================
Index: xfs-cmds/xfsprogs/copy/xfs_copy.c
===================================================================
--- xfs-cmds.orig/xfsprogs/copy/xfs_copy.c 2006-10-06 13:55:01.000000000
+1000
+++ xfs-cmds/xfsprogs/copy/xfs_copy.c 2006-10-06 13:52:14.000000000 +1000
@@ -77,17 +77,23 @@
va_list ap;
int eek = 0;
- va_start(ap, fmt);
- if (flags & LOG)
+ if (flags & LOG) {
+ va_start(ap, fmt);
if (vfprintf(logerr, fmt, ap) <= 0)
eek = 1;
+ va_end(ap);
+ }
if (eek)
flags |= ERR; /* failed, force stderr */
- if (flags & ERR)
+ if (flags & ERR) {
+ va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
- else if (flags & OUT)
+ va_end(ap);
+ } else if (flags & OUT) {
+ va_start(ap, fmt);
vfprintf(stdout, fmt, ap);
- va_end(ap);
+ va_end(ap);
+ }
if (flags & PRE) {
do_message(flags & ~PRE, 0, ": %s\n", strerror(code));
|