winlin

refine code, unify the coding style

@@ -97,15 +97,15 @@ int run() @@ -97,15 +97,15 @@ int run()
97 97
98 int pid = fork(); 98 int pid = fork();
99 99
100 - if(pid == -1){ 100 + if(pid == -1) {
101 srs_error("create process error. ret=-1"); //ret=0 101 srs_error("create process error. ret=-1"); //ret=0
102 return -1; 102 return -1;
103 } 103 }
104 104
105 // grandpa 105 // grandpa
106 - if(pid > 0){ 106 + if(pid > 0) {
107 int status = 0; 107 int status = 0;
108 - if(waitpid(pid, &status, 0) == -1){ 108 + if(waitpid(pid, &status, 0) == -1) {
109 srs_error("wait child process error! ret=-1"); //ret=0 109 srs_error("wait child process error! ret=-1"); //ret=0
110 } 110 }
111 srs_trace("grandpa process exit."); 111 srs_trace("grandpa process exit.");
@@ -116,12 +116,12 @@ int run() @@ -116,12 +116,12 @@ int run()
116 // father 116 // father
117 pid = fork(); 117 pid = fork();
118 118
119 - if(pid == -1){ 119 + if(pid == -1) {
120 srs_error("create process error. ret=-1"); 120 srs_error("create process error. ret=-1");
121 return -1; 121 return -1;
122 } 122 }
123 123
124 - if(pid > 0){ 124 + if(pid > 0) {
125 srs_trace("father process exit. ret=-1"); 125 srs_trace("father process exit. ret=-1");
126 exit(0); 126 exit(0);
127 return 0; 127 return 0;