[LTP] [PATCH] mtest06: Use temp dir from $TMPDIR if present

Cyril Hrubis chrubis@suse.cz
Thu Mar 8 15:07:23 CET 2018


Hi!
Good catch, but given that the temporary directory created by
tst_tmpdir() is unique we can as well drop the whole mkstemp()
and replace it with just open().

#define FNAME "ashfile"

int mkfile(int size)
{
	int fd;

	fd = open(FNAME,  O_RDWR | O_CREAT, 0600);
	if (fd < 0)
		tst_brk(...);

	unlink(FNAME);

	...

	return fd;
}


-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list