~ubuntu-branches/debian/sid/nordugrid-arc/sid

« back to all changes in this revision

Viewing changes to src/services/gridftpd/listener.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2012-12-13 16:41:31 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20121213164131-0fumka0jar8mxm07
Tags: 2.0.1-1
* 2.0.1 Release
* Drop patches accepted upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
static void (*sig_old_chld)(int) = SIG_ERR;
92
92
 
93
93
void sig_chld(int /* signum */) {
 
94
  int old_errno = errno;
94
95
  int status;
95
96
  for(;;) {
96
97
    int id=waitpid(-1,&status,WNOHANG);
98
99
    curr_connections--;
99
100
    if(curr_connections < -10) curr_connections=-10;
100
101
  };
 
102
  errno = old_errno;
101
103
}
102
104
 
103
105
#ifdef __USE_RESURECTION__
104
106
void sig_term(int signum) {
 
107
  int old_errno = errno;
105
108
  if(chid == -1) return;
106
109
  if(chid == 0) {
107
110
    server_done = 1;
114
117
  else {
115
118
    kill(chid,SIGTERM);
116
119
  };
 
120
  errno = old_errno;
117
121
};
118
122
 
119
123
int main_internal(int argc,char** argv);
165
169
int main_internal(int argc,char** argv) {
166
170
#else
167
171
void sig_term_fork(int /* signum */) {
 
172
  int old_errno = errno;
168
173
  int static passed = 0;
169
174
  if(passed) _exit(-1);
170
175
  server_done=1;
171
176
  passed=1;
172
177
  kill(0,SIGTERM);
 
178
  errno = old_errno;
173
179
}
174
180
 
175
181
int main(int argc,char** argv) {