From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] ppoll01: rewrite in new API
Date: Tue, 24 May 2016 14:53:50 +0200 [thread overview]
Message-ID: <20160524125349.GE10029@rei.lan> (raw)
In-Reply-To: <d7a24122b97ae88bdeb9d864240137494d52ee0c.1464077434.git.jstancek@redhat.com>
Hi!
> +static void setup(void)
> +{
> + int fd2;
> +
> + SAFE_SIGNAL(SIGINT, sighandler);
> +
> + if (sigemptyset(&sigmask_empty) == -1)
> + tst_brk(TBROK | TERRNO, "sigemptyset");
> + if (sigemptyset(&sigmask_sigint) == -1)
> + tst_brk(TBROK | TERRNO, "sigemptyset");
> + if (sigaddset(&sigmask_sigint, SIGINT) == -1)
> + tst_brk(TBROK | TERRNO, "sigaddset");
> +
> + fd1 = SAFE_OPEN("testfile1", O_CREAT | O_EXCL | O_RDWR,
> + S_IRUSR | S_IWUSR);
> + fds_good[0].fd = fd1;
> + fds_good[0].events = POLLIN | POLLPRI | POLLOUT | POLLRDHUP;
> + fds_good[0].revents = 0;
> +
> + fd2 = SAFE_OPEN("testfile2", O_CREAT | O_EXCL | O_RDWR,
> + S_IRUSR | S_IWUSR);
> + fds_already_closed[0].fd = fd2;
> + fds_already_closed[0].events = POLLIN | POLLPRI | POLLOUT | POLLRDHUP;
> + fds_already_closed[0].revents = 0;
> + SAFE_CLOSE(fd2);
> + SAFE_UNLINK("testfile2");
There is also no need to unlink the testfile here.
> +}
> +
> +static void cleanup(void)
> +{
> + SAFE_CLOSE(fd1);
> + SAFE_UNLINK("testfile1");
And here, since tst_rmdir() will take care of that.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2016-05-24 12:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 8:14 [LTP] [PATCH] ppoll01: rewrite in new API Jan Stancek
2016-05-24 8:35 ` Jan Stancek
2016-05-24 12:54 ` Cyril Hrubis
2016-05-24 12:53 ` Cyril Hrubis [this message]
2016-05-24 13:51 ` [LTP] [PATCH v2] " Jan Stancek
2016-05-24 14:57 ` Cyril Hrubis
2016-05-25 7:44 ` Jan Stancek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160524125349.GE10029@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.