]> git.ozlabs.org Git - ccan/blobdiff - ccan/opt/test/utils.c
iscsi, nfs, opt, tap: use config.h instead of defining _GNU_SOURCE.
[ccan] / ccan / opt / test / utils.c
index 5b054f87f315ce7524dd5c90456467c29e80e777..fa0a2022e0987368e398161bbce28d60fd43b028 100644 (file)
@@ -1,4 +1,4 @@
-#define _GNU_SOURCE
+#include "config.h"
 #include <ccan/tap/tap.h>
 #include <stdarg.h>
 #include <stdlib.h>
@@ -35,7 +35,9 @@ static void save_err_output(const char *fmt, ...)
        char *p;
 
        va_start(ap, fmt);
-       vasprintf(&p, fmt, ap);
+       /* Check return, for fascist gcc */
+       if (vasprintf(&p, fmt, ap) == -1)
+               p = NULL;
        va_end(ap);
 
        if (err_output) {