winlin

should never close the fd 3+, for it myabe used.

@@ -211,6 +211,9 @@ int SrsProcess::start() @@ -211,6 +211,9 @@ int SrsProcess::start()
211 } 211 }
212 } 212 }
213 213
  214 + // should never close the fd 3+, for it myabe used.
  215 + // for fd should close at exec, use fnctl to set it.
  216 +
214 // log basic info 217 // log basic info
215 if (true) { 218 if (true) {
216 fprintf(stderr, "\n"); 219 fprintf(stderr, "\n");
@@ -220,12 +223,6 @@ int SrsProcess::start() @@ -220,12 +223,6 @@ int SrsProcess::start()
220 fprintf(stderr, "process actual cli: %s\n", actual_cli.c_str()); 223 fprintf(stderr, "process actual cli: %s\n", actual_cli.c_str());
221 } 224 }
222 225
223 - // close other fds  
224 - // TODO: do in right way.  
225 - for (int i = 3; i < 1024; i++) {  
226 - ::close(i);  
227 - }  
228 -  
229 // memory leak in child process, it's ok. 226 // memory leak in child process, it's ok.
230 char** charpv_params = new char*[params.size() + 1]; 227 char** charpv_params = new char*[params.size() + 1];
231 for (int i = 0; i < (int)params.size(); i++) { 228 for (int i = 0; i < (int)params.size(); i++) {