flow.c
author Lluís Batlle <viric@viric.name>
Thu, 20 Mar 2014 16:33:27 +0100
changeset 97 eea77d5a624c
parent 66 b2469563a1dc
permissions -rw-r--r--
Merging the savefile branch. I hope it works; I even don't remember it.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
66
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     1
/*
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     2
    Terminal Mixer - multi-point multi-user access to terminal applications
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     3
    Copyright (C) 2007  LluĂ­s Batlle i Rossell
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     4
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     5
    Please find the license in the provided COPYING file.
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     6
*/
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     7
#include <stdlib.h>
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     8
#include <unistd.h>
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
     9
#include <sys/select.h>
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    10
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    11
#include "main.h"
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    12
#include "handlers.h"
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    13
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    14
void avoid_sending(fd_set *read_set)
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    15
{
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    16
    dump_line("Avoid sending\n");
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    17
    if (command_line.is_server)
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    18
    {
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    19
        if (app_stdout >= 0)
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    20
            FD_CLR(app_stdout, read_set);
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    21
        if (app_stderr >= 0)
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    22
            FD_CLR(app_stderr, read_set);
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    23
    }
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    24
    else
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    25
    {
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    26
            FD_CLR(0, read_set); /* client terminal stdin */
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    27
    }
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
diff changeset
    28
}