~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/render/rConsoleCout.cpp

  • Committer: z-man
  • Date: 2008-01-10 10:48:46 UTC
  • Revision ID: svn-v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs:7d95bf1e-0414-0410-9756-b78462a59f44:armagetronad%2Fbranches%2F0.2.8%2Farmagetronad:7495
Unblocking stdin before every read. SIGSTOP signals cause it to get blocked, freezing the server.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
}
67
67
 
68
68
 
 
69
 
69
70
#define MAXLINE 1000
70
71
static char line_in[MAXLINE+2];
71
72
static int currentIn=0;
121
122
 
122
123
 
123
124
#else
124
 
    while (read(stdin_descriptor,&line_in[currentIn],1)>0){
125
 
        if (line_in[currentIn]=='\n' || currentIn>=MAXLINE-1){
 
125
    // unblock stdin before every read. SIGSTOP blocks it.
 
126
    if ( unblocked )
 
127
    {
 
128
        sr_Unblock_stdin();
 
129
    }
 
130
 
 
131
    while ( read(stdin_descriptor,&line_in[currentIn],1)>0){
 
132
        if (line_in[currentIn]=='\n' || currentIn>=MAXLINE-1)
 
133
        {
126
134
            line_in[currentIn+1]='\0';
127
135
            std::stringstream s(line_in);
128
136
            tConfItemBase::LoadAll(s);
129
137
            currentIn=0;
 
138
 
 
139
            if ( unblocked )
 
140
            {
 
141
                sr_Unblock_stdin();
 
142
            }
130
143
        }
131
144
        else
132
145
            currentIn++;