OBS User unknown
2007-06-09 09:47:25 +00:00
committed by Git OBS Bridge
parent 5a31fb9842
commit 6349b62b6e
8 changed files with 200 additions and 8 deletions

View File

@@ -142,3 +142,53 @@ Index: xen-3.1-testing/tools/blktap/drivers/block-qcow.c
return -1;
}
}
Index: xen-3.1-testing/tools/xenstore/utils.c
===================================================================
--- xen-3.1-testing.orig/tools/xenstore/utils.c
+++ xen-3.1-testing/tools/xenstore/utils.c
@@ -27,33 +27,38 @@ void xprintf(const char *fmt, ...)
void barf(const char *fmt, ...)
{
char *str;
+ int bytes;
va_list arglist;
xprintf("FATAL: ");
va_start(arglist, fmt);
- vasprintf(&str, fmt, arglist);
+ bytes = vasprintf(&str, fmt, arglist);
va_end(arglist);
- xprintf("%s\n", str);
- free(str);
+ if (bytes >= 0) {
+ xprintf("%s\n", str);
+ free(str);
+ }
exit(1);
}
void barf_perror(const char *fmt, ...)
{
char *str;
- int err = errno;
+ int bytes, err = errno;
va_list arglist;
xprintf("FATAL: ");
va_start(arglist, fmt);
- vasprintf(&str, fmt, arglist);
+ bytes = vasprintf(&str, fmt, arglist);
va_end(arglist);
- xprintf("%s: %s\n", str, strerror(err));
- free(str);
+ if (bytes >= 0) {
+ xprintf("%s: %s\n", str, strerror(err));
+ free(str);
+ }
exit(1);
}