[PATCH 7/7] Adding pipe support
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Dec 12 07:42:38 UTC 2016
On 09/12/16 21:26, Kevin Kirspel wrote:
> @@ -280,10 +298,14 @@ start_worker(test_context *ctx)
> static void
> set_non_blocking(int fd, int enable)
> {
> - int rv;
> + int flags = fcntl(fd, F_GETFL, 0);
>
> - rv = ioctl(fd, FIONBIO, &enable);
> - assert(rv == 0);
> + if (enable ) {
> + fcntl(fd, F_SETFL, flags | O_NONBLOCK);
> + }
> + else{
> + fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
> + }
> }
All return values should be checked in the tests. Please use BSD style
for the { }.
Please remove all white-space changes of original BSD files.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel
mailing list