| | @@ -1153,11 +1153,13 @@ |
| 1153 | 1153 | fossil_print("Listening for HTTP requests on TCP port %d\n", iPort); |
| 1154 | 1154 | fflush(stdout); |
| 1155 | 1155 | } |
| 1156 | 1156 | if( zBrowser ){ |
| 1157 | 1157 | zBrowser = mprintf(zBrowser, iPort); |
| 1158 | | - system(zBrowser); |
| 1158 | + if( system(zBrowser)<0 ){ |
| 1159 | + fossil_warning("cannot start browser: %s\n", zBrowser); |
| 1160 | + } |
| 1159 | 1161 | } |
| 1160 | 1162 | while( 1 ){ |
| 1161 | 1163 | if( nchildren>MAX_PARALLEL ){ |
| 1162 | 1164 | /* Slow down if connections are arriving too fast */ |
| 1163 | 1165 | sleep( nchildren-MAX_PARALLEL ); |
| | @@ -1174,20 +1176,24 @@ |
| 1174 | 1176 | child = fork(); |
| 1175 | 1177 | if( child!=0 ){ |
| 1176 | 1178 | if( child>0 ) nchildren++; |
| 1177 | 1179 | close(connection); |
| 1178 | 1180 | }else{ |
| 1181 | + int nErr = 0, fd; |
| 1179 | 1182 | close(0); |
| 1180 | | - dup(connection); |
| 1183 | + fd = dup(connection); |
| 1184 | + if( fd!=0 ) nErr++; |
| 1181 | 1185 | close(1); |
| 1182 | | - dup(connection); |
| 1186 | + fd = dup(connection); |
| 1187 | + if( fd!=1 ) nErr++; |
| 1183 | 1188 | if( !g.fHttpTrace && !g.fSqlTrace ){ |
| 1184 | 1189 | close(2); |
| 1185 | | - dup(connection); |
| 1190 | + fd = dup(connection); |
| 1191 | + if( fd!=2 ) nErr++; |
| 1186 | 1192 | } |
| 1187 | 1193 | close(connection); |
| 1188 | | - return 0; |
| 1194 | + return nErr; |
| 1189 | 1195 | } |
| 1190 | 1196 | } |
| 1191 | 1197 | } |
| 1192 | 1198 | /* Bury dead children */ |
| 1193 | 1199 | while( waitpid(0, 0, WNOHANG)>0 ){ |
| 1194 | 1200 | |