-#define _GNU_SOURCE
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
#include <assert.h>
#include <string.h>
static char *local_name(void *ctx)
{
- char *tmp, *ret;
+ char *ret, tmp[] = "/tmp/pb-XXXXXX";
+ int fd;
- tmp = tempnam(NULL, "pb-");
+ fd = mkstemp(tmp);
- if (!tmp)
+ if (fd < 0)
return NULL;
+ close(fd);
+
ret = talloc_strdup(ctx, tmp);
- free(tmp);
return ret;
}
process->path = pb_system_apps.tftp;
process->argv = argv;
process->keep_stdout = true;
+ process->add_stderr = true;
process_run_sync(process);
if (!process->stdout_buf || process->stdout_len == 0) {