1 | /* |
---|
2 | * linuxdvb output/writer handling. |
---|
3 | * |
---|
4 | * konfetti 2010 |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation; either version 2 of the License, or |
---|
9 | * (at your option) any later version. |
---|
10 | * |
---|
11 | * This program is distributed in the hope that it will be useful, |
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | * GNU General Public License for more details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU General Public License |
---|
17 | * along with this program; if not, write to the Free Software |
---|
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
19 | * |
---|
20 | */ |
---|
21 | |
---|
22 | /* ***************************** */ |
---|
23 | /* Includes */ |
---|
24 | /* ***************************** */ |
---|
25 | #include <stdlib.h> |
---|
26 | #include <string.h> |
---|
27 | #include <errno.h> |
---|
28 | |
---|
29 | #include "misc.h" |
---|
30 | #include "writer.h" |
---|
31 | #include "debug.h" |
---|
32 | #include "common.h" |
---|
33 | |
---|
34 | /* ***************************** */ |
---|
35 | /* Makros/Constants */ |
---|
36 | /* ***************************** */ |
---|
37 | |
---|
38 | /* ***************************** */ |
---|
39 | /* Types */ |
---|
40 | /* ***************************** */ |
---|
41 | |
---|
42 | /* ***************************** */ |
---|
43 | /* Varaibles */ |
---|
44 | /* ***************************** */ |
---|
45 | |
---|
46 | /* ***************************** */ |
---|
47 | /* Prototypes */ |
---|
48 | /* ***************************** */ |
---|
49 | |
---|
50 | /* ***************************** */ |
---|
51 | /* Functions */ |
---|
52 | /* ***************************** */ |
---|
53 | void FlushPipe(int pipefd) |
---|
54 | { |
---|
55 | char tmp; |
---|
56 | while(1 == read(pipefd, &tmp, 1)); |
---|
57 | } |
---|
58 | |
---|
59 | ssize_t WriteExt(WriteV_t _call, int fd, void *data, size_t size) |
---|
60 | { |
---|
61 | struct iovec iov[1]; |
---|
62 | iov[0].iov_base = data; |
---|
63 | iov[0].iov_len = size; |
---|
64 | return _call(fd, iov, 1); |
---|
65 | } |
---|