version 1.1, 2006/02/20 08:38:18 |
version 1.2, 2006/03/11 07:12:42 |
|
|
*/ |
*/ |
|
|
#include <err.h> |
#include <err.h> |
|
#include <paths.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
const char *tmpdir; |
const char *tmpdir; |
char *filename; |
char *filename; |
|
|
/* If TMPDIR is set, use it; otherwise use /tmp. */ |
/* If TMPDIR is set, use it; otherwise use _PATH_TMP. */ |
if (!(tmpdir = getenv("TMPDIR"))) |
if (!(tmpdir = getenv("TMPDIR"))) |
tmpdir = "/tmp"; |
tmpdir = _PATH_TMP; |
if (asprintf(&filename, "%s/sdiff.XXXXXXXXXX", tmpdir) == -1) |
if (asprintf(&filename, "%s/sdiff.XXXXXXXXXX", tmpdir) == -1) |
err(2, "xmktemp"); |
err(2, "xmktemp"); |
|
|