| 25 |
int pid; |
int pid; |
| 26 |
|
|
| 27 |
if (pid = fork ()) |
if (pid = fork ()) |
| 28 |
|
{ |
| 29 |
|
SYS_child_process_count ++; |
| 30 |
|
log_std ("Child process (%d) start\n", pid); |
| 31 |
return 0; |
return 0; |
| 32 |
|
} |
| 33 |
else if (pid < 0) |
else if (pid < 0) |
| 34 |
return -1; |
return -1; |
| 35 |
|
|
|
log_std ("Child process start\n"); |
|
| 36 |
|
|
| 37 |
if (close (socket_server) == -1) |
if (close (socket_server) == -1) |
| 38 |
{ |
{ |
| 63 |
log_error ("Close client socket failed\n"); |
log_error ("Close client socket failed\n"); |
| 64 |
} |
} |
| 65 |
|
|
|
log_std ("Child process exit\n"); |
|
|
|
|
| 66 |
//Close Input and Output for client |
//Close Input and Output for client |
| 67 |
close (0); |
close (0); |
| 68 |
close (1); |
close (1); |
| 69 |
|
|
| 70 |
|
log_std ("Process exit normally\n"); |
| 71 |
|
|
| 72 |
log_end (); |
log_end (); |
| 73 |
|
|
| 74 |
//Exit child process normally |
//Exit child process normally |