Mercurial > dovecot > original-hg > dovecot-1.2
view src/lib/fd-set-nonblock.c @ 6429:65c69a53a7be HEAD
Replaced my Copyright notices. The year range always ends with 2007 now.
My name was replaced with "Dovecot authors". In many cases I didn't really
even own the copyright, so this is more correct.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 16 Sep 2007 14:34:22 +0300 |
parents | 55df57c028d4 |
children | 7ed926ed7aa4 |
line wrap: on
line source
/* Copyright (c) 1999-2007 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "fd-set-nonblock.h" #include <fcntl.h> int fd_set_nonblock(int fd, bool nonblock) { int flags; flags = fcntl(fd, F_GETFL, 0); if (flags < 0) { i_error("fcntl(%d, F_GETFL) failed: %m", fd); return -1; } if (nonblock) flags |= O_NONBLOCK; else flags &= ~O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) < 0) { i_error("fcntl(%d, F_SETFL) failed: %m", fd); return -1; } return 0; }