diff options
| author | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
| commit | 69aec538b456402170dc723af417ba5c05389c32 (patch) | |
| tree | e6f34c543f17c6392447ea337b2e2868212424d1 /trynpbg1.c | |
| download | qmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2 qmail-69aec538b456402170dc723af417ba5c05389c32.zip | |
qmail 1.03 import
Diffstat (limited to 'trynpbg1.c')
| -rw-r--r-- | trynpbg1.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/trynpbg1.c b/trynpbg1.c new file mode 100644 index 0000000..9d5f80b --- /dev/null +++ b/trynpbg1.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #include "select.h" | ||
| 2 | #include "open.h" | ||
| 3 | #include "fifo.h" | ||
| 4 | |||
| 5 | #define FN "temp-trynpbg1.fifo" | ||
| 6 | |||
| 7 | void main() | ||
| 8 | { | ||
| 9 | int flagbug; | ||
| 10 | struct timeval instant; | ||
| 11 | fd_set rfds; | ||
| 12 | |||
| 13 | flagbug = 0; | ||
| 14 | if (fifo_make(FN,0600) != -1) { | ||
| 15 | close(0); | ||
| 16 | if (open_read(FN) == 0) { | ||
| 17 | FD_ZERO(&rfds); | ||
| 18 | FD_SET(0,&rfds); | ||
| 19 | instant.tv_sec = instant.tv_usec = 0; | ||
| 20 | if (select(1,&rfds,(fd_set *) 0,(fd_set *) 0,&instant) > 0) | ||
| 21 | flagbug = 1; | ||
| 22 | } | ||
| 23 | unlink(FN); | ||
| 24 | } | ||
| 25 | _exit(!flagbug); | ||
| 26 | } | ||
