server.c
author viric@mandarina
Mon, 28 Apr 2008 21:37:25 +0200
changeset 90 f172b95795d8
parent 86 c972d3312fbd
child 94 330324fc7c20
permissions -rw-r--r--
Moving to version 0.4.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
53
07500c5c53cb Adding license and web html.
viric@llimona
parents: 49
diff changeset
     1
/*
07500c5c53cb Adding license and web html.
viric@llimona
parents: 49
diff changeset
     2
    Terminal Mixer - multi-point multi-user access to terminal applications
07500c5c53cb Adding license and web html.
viric@llimona
parents: 49
diff changeset
     3
    Copyright (C) 2007  LluĂ­s Batlle i Rossell
07500c5c53cb Adding license and web html.
viric@llimona
parents: 49
diff changeset
     4
07500c5c53cb Adding license and web html.
viric@llimona
parents: 49
diff changeset
     5
    Please find the license in the provided COPYING file.
07500c5c53cb Adding license and web html.
viric@llimona
parents: 49
diff changeset
     6
*/
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
     7
#include <stdio.h>
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
     8
#include <stdlib.h>
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
     9
#include <sys/types.h>
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    10
#include <sys/select.h>
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    11
#include <unistd.h>
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    12
#include <errno.h>
67
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    13
#include <signal.h>
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    14
#include <string.h>
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    15
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    16
#include "main.h"
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    17
#include "handlers.h"
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    18
82
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    19
/* signals.c */
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    20
extern int child_died;
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    21
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    22
/*extern*/
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    23
void fdset_dump(fd_set *set, int maxfd);
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    24
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    25
static void loop()
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    26
{
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    27
    fd_set read_set;
86
c972d3312fbd Better variable names: sigold to sigempty
lbatlle@npdl268.bpo.hp.com
parents: 84
diff changeset
    28
    sigset_t sigempty,signoalarm;
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    29
    int maxfd;
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    30
    int stdin_opened;
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    31
    int res;
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    32
41
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
    33
    if (command_line.s_param.nohup)
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
    34
        stdin_opened = 0;
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
    35
    else
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
    36
        stdin_opened = 1;
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
    37
67
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    38
    /* Prepare the sigset for blocking alarm */
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    39
    sigemptyset(&signoalarm);
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    40
    sigaddset(&signoalarm, SIGALRM);
86
c972d3312fbd Better variable names: sigold to sigempty
lbatlle@npdl268.bpo.hp.com
parents: 84
diff changeset
    41
    sigemptyset(&sigempty);
67
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    42
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    43
    do
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    44
    {
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    45
        FD_ZERO(&read_set);
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    46
82
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    47
        maxfd = -1;
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    48
        if (stdin_opened)
82
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    49
        {
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    50
            FD_SET(0, &read_set);
82
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    51
            maxfd = 0;
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    52
        }
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    53
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    54
        app_control_prepare_read_fdset(&read_set, &maxfd);
33
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
    55
        if (command_line.s_param.serve_unix)
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
    56
            s_unix_prepare_read_fdset(&read_set, &maxfd);
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
    57
        if (command_line.s_param.serve_tcp)
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
    58
            s_tcp_prepare_read_fdset(&read_set, &maxfd);
49
1cead94cfd99 Fixing a few bugs. The program runs well in Linux and Mac OS X.
viric@llimona
parents: 44
diff changeset
    59
#ifdef linux
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
    60
        if (command_line.s_param.serve_eth)
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
    61
            s_eth_prepare_read_fdset(&read_set, &maxfd);
49
1cead94cfd99 Fixing a few bugs. The program runs well in Linux and Mac OS X.
viric@llimona
parents: 44
diff changeset
    62
#endif /* linux */
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    63
67
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    64
        /* Prepare checking for timeout */
86
c972d3312fbd Better variable names: sigold to sigempty
lbatlle@npdl268.bpo.hp.com
parents: 84
diff changeset
    65
        sigprocmask(SIG_BLOCK, &signoalarm, 0);
67
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    66
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    67
#ifdef linux
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    68
        if (command_line.s_param.serve_eth)
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    69
            /* This will check if the timeout occurred,
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    70
             * and will not do anything otherwise. */
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    71
            eth_proto_process_timeouts();
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    72
#endif
d7405e4f12e1 The timeout should be always handled. Now we use pselect in the loops.
viric@mandarina
parents: 66
diff changeset
    73
82
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    74
        if (maxfd == -1)
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    75
          error("No fds in select");
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    76
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    77
        debugmsg("Blocking in pselect");
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    78
        if (child_died == 1)
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    79
          break;
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
    80
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    81
        /* Will block */
86
c972d3312fbd Better variable names: sigold to sigempty
lbatlle@npdl268.bpo.hp.com
parents: 84
diff changeset
    82
        res = pselect(maxfd + 1, &read_set, 0, 0, 0, &sigempty);
66
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents: 53
diff changeset
    83
#ifdef linux
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents: 53
diff changeset
    84
        if (command_line.s_param.serve_eth)
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents: 53
diff changeset
    85
            eth_proto_process_timeouts();
b2469563a1dc Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents: 53
diff changeset
    86
#endif
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    87
        if (res == -1)
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    88
        {
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    89
            if (errno == EINTR)
84
150a622f26ea Fixing eth_proto bugs. There was no ACK working until now (SIGALARM problems).
lbatlle@npdl268.bpo.hp.com
parents: 82
diff changeset
    90
            {
150a622f26ea Fixing eth_proto bugs. There was no ACK working until now (SIGALARM problems).
lbatlle@npdl268.bpo.hp.com
parents: 82
diff changeset
    91
                dump_line("Signal received in server select()\n");
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    92
                continue;
84
150a622f26ea Fixing eth_proto bugs. There was no ACK working until now (SIGALARM problems).
lbatlle@npdl268.bpo.hp.com
parents: 82
diff changeset
    93
            }
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    94
            else
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    95
                error("Error in select()");
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    96
        }
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    97
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    98
        res = app_control_process_read_fdset(&read_set);
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
    99
        if (res == -1) /* app_stdout and app_stderr closed */
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   100
            break;
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   101
41
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   102
        if (stdin_opened && FD_ISSET(0, &read_set))
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   103
        {
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   104
            res = read(0, stream_buffer, stream_buffer_size);
32
df110f784648 Added read-only clients, added stdin-close option to clients.
lbatlle@npdl268.bpo.hp.com
parents: 29
diff changeset
   105
            /* if res is 0, the fcall will close app_stdin */
df110f784648 Added read-only clients, added stdin-close option to clients.
lbatlle@npdl268.bpo.hp.com
parents: 29
diff changeset
   106
            app_control_local_send_to_stdin(stream_buffer, res);
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   107
            if (res == 0)
82
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
   108
            {
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
   109
                debugmsg("Closing stdin\n");
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   110
                stdin_opened = 0;
82
5cbe47923060 Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents: 71
diff changeset
   111
            }
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   112
        }
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   113
33
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
   114
        if (command_line.s_param.serve_unix)
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
   115
            s_unix_process_read_fdset(&read_set);
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
   116
        if (command_line.s_param.serve_tcp)
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
   117
            s_tcp_process_read_fdset(&read_set);
49
1cead94cfd99 Fixing a few bugs. The program runs well in Linux and Mac OS X.
viric@llimona
parents: 44
diff changeset
   118
#ifdef linux
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
   119
        if (command_line.s_param.serve_eth)
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
   120
            s_eth_process_read_fdset(&read_set);
49
1cead94cfd99 Fixing a few bugs. The program runs well in Linux and Mac OS X.
viric@llimona
parents: 44
diff changeset
   121
#endif /* linux */
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   122
    } while(1);
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   123
}
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   124
29
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   125
int server()
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   126
{
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   127
    int child;
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   128
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   129
    command_line.is_server = 1;
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   130
36
da427c23d755 Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents: 33
diff changeset
   131
    app_control_start();
da427c23d755 Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents: 33
diff changeset
   132
29
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   133
    /* in raw mode, the signals for Control-C, ... will be generated by the
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   134
     * slave pty. The master will receive the key codes. */
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   135
    if (command_line.s_param.serve_unix)
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   136
        s_unix_update_served(command_line.s_param.max_served);
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   137
29
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   138
    if (command_line.s_param.serve_tcp)
33
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
   139
        s_tcp_update_served(command_line.s_param.max_served);
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   140
49
1cead94cfd99 Fixing a few bugs. The program runs well in Linux and Mac OS X.
viric@llimona
parents: 44
diff changeset
   141
#ifdef linux
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
   142
    if (command_line.s_param.serve_eth)
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
   143
        s_eth_init();
49
1cead94cfd99 Fixing a few bugs. The program runs well in Linux and Mac OS X.
viric@llimona
parents: 44
diff changeset
   144
#endif /* linux */
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
   145
40
da3ea7f666e3 Fixed env vars and paths for the unix socket.
viric@llimona
parents: 36
diff changeset
   146
    child = fork_app(command_line.s_param.command);
da3ea7f666e3 Fixed env vars and paths for the unix socket.
viric@llimona
parents: 36
diff changeset
   147
41
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   148
    if (command_line.s_param.nohup)
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   149
    {
71
c209487034d7 True nohup-like behaviour. Programs ignore to SIGHUP.
viric@llimona
parents: 67
diff changeset
   150
        ignore_sighup();
41
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   151
        close(0);
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   152
        close(1);
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   153
        close(2);
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   154
    } else
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   155
        if (command_line.s_param.run_in_subterminal)
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   156
            prepare_user_terminal();
40
da3ea7f666e3 Fixed env vars and paths for the unix socket.
viric@llimona
parents: 36
diff changeset
   157
da3ea7f666e3 Fixed env vars and paths for the unix socket.
viric@llimona
parents: 36
diff changeset
   158
    install_signal_forwarders(child);
da3ea7f666e3 Fixed env vars and paths for the unix socket.
viric@llimona
parents: 36
diff changeset
   159
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   160
    loop();
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   161
29
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   162
    if (command_line.s_param.serve_unix)
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   163
        s_unix_shutdown();
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   164
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   165
    if (command_line.s_param.serve_tcp)
33
010af11f521e Raw implementation for tcp.
lbatlle@npdl268.bpo.hp.com
parents: 32
diff changeset
   166
        s_tcp_shutdown();
29
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   167
49
1cead94cfd99 Fixing a few bugs. The program runs well in Linux and Mac OS X.
viric@llimona
parents: 44
diff changeset
   168
#ifdef linux
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
   169
    if (command_line.s_param.serve_eth)
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
   170
        s_eth_shutdown();
49
1cead94cfd99 Fixing a few bugs. The program runs well in Linux and Mac OS X.
viric@llimona
parents: 44
diff changeset
   171
#endif /* linux */
44
41241a0f84bf Almost fixed eth transport.
viric@llimona
parents: 41
diff changeset
   172
41
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   173
    if (!command_line.s_param.nohup &&
954941c6e40a Added 'nohup' option -n.
viric@llimona
parents: 40
diff changeset
   174
            command_line.s_param.run_in_subterminal)
29
91286c3ecebc Added getopt, and some things got based on parameters.
viric@llimona
parents: 26
diff changeset
   175
        restore_user_terminal();
23
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   176
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   177
    return 0;
b3e6c6ffc69c Moving the client out.
viric@llimona
parents:
diff changeset
   178
}