public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] What is wrong with this program ?
@ 2020-04-28  9:47 Viresh Kumar
  2020-04-28  9:52 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2020-04-28  9:47 UTC (permalink / raw)
  To: ltp

#include "tst_test.h"

static void run(void)
{
	int fd;

	fd = SAFE_OPEN("file", O_RDWR | O_CREAT);
	SAFE_CLOSE(fd);
	fd = SAFE_OPEN("file", O_RDWR | O_CREAT);
}

static struct tst_test test = {
	.test_all = run,
	.needs_tmpdir = 1,
};


It fails with:

safe_macros.c:230: BROK: foo.c:9: open(file,66,01) failed: EACCES (13)

if run as a normal user and passes with sudo.

-- 
viresh

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-28 11:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-28  9:47 [LTP] What is wrong with this program ? Viresh Kumar
2020-04-28  9:52 ` Cyril Hrubis
2020-04-28 10:02   ` Viresh Kumar
2020-04-28 10:09     ` Martin Doucha
2020-04-28 11:49     ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox