aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/opentemp.c
blob: f90bf771b67e5a0b18c94065c930368dd3f9c236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <u.h>
#include <libc.h>

int
opentemp(char *template)
{
	int fd;

	fd = mkstemp(template);
	if(fd < 0)
		return -1;
	remove(template);
	return fd;
}