Revision db97be63

View differences:

fifo.c
9 9
#include <sys/time.h>
10 10
#include <sys/types.h>
11 11
#include <unistd.h>
12
#include <unistd.h>
13
#include <fcntl.h>
12 14

  
13 15
#define MAX(a,b) ((a>b) ? a : b)
14 16
#define MIN(a,b) ((a>b) ? b : a)
......
42 44
  fd_set rfds, wfds;
43 45
  int reof = 0;
44 46
  int retval;
47
  int flags;
45 48

  
46 49
  cmdline_parse(argc, argv);
47 50

  
51
  flags = fcntl(0, F_GETFL, 0);
52
  fcntl(0, F_SETFL, flags | O_NONBLOCK);
53

  
54
  flags = fcntl(1, F_GETFL, 0);
55
  fcntl(1, F_SETFL, flags | O_NONBLOCK);
56

  
48 57
  buf = rpos = wpos = malloc(bufsize);
49 58
  if (!buf) {
50 59
    fprintf(stderr, "Error: can't allocate buffer of %lu bytes\n", bufsize);

Also available in: Unified diff