]> git.saurik.com Git - apt.git/blame - test/interactive-helper/mthdcat.cc
abort connection on '.' target replies in SRV
[apt.git] / test / interactive-helper / mthdcat.cc
CommitLineData
8bb5959b
AL
1/* Usage, mthdcat < cmds | methods/mthd
2 All this does is cat a file into the method without closing the FD when
3 the file ends */
4
453b82a3
DK
5#include <config.h>
6
8bb5959b
AL
7#include <unistd.h>
8
9int main()
10{
11 char Buffer[4096];
12
13 while (1)
14 {
15 int Res = read(STDIN_FILENO,Buffer,sizeof(Buffer));
16 if (Res <= 0)
17 while (1) sleep(100);
18 if (write(STDOUT_FILENO,Buffer,Res) != Res)
19 break;
20 }
21 return 0;
22}