71 |
|
|
72 |
|
/* Need to open 2 files, one for reading one for writing, as it gets confused if we only use 1 :) */ |
73 |
|
if ((fm_fd_r=fdopen(sd,"r")) == NULL){ |
74 |
< |
errf("Failed to open stream (%m)"); |
74 |
> |
errf("Failed to open read stream (%m)"); |
75 |
|
return -1; |
76 |
|
} |
77 |
|
|
78 |
|
if ((fm_fd_w=fdopen(dup(sd),"w")) == NULL){ |
79 |
< |
errf("Failed to open stream (%m)"); |
79 |
> |
errf("Failed to open write stream (%m)"); |
80 |
|
return -1; |
81 |
|
} |
82 |
|
|
155 |
|
errf("strdup failed (%m)"); |
156 |
|
return -1; |
157 |
|
} |
158 |
< |
reply=++reply_ptr; |
158 |
> |
reply=reply_ptr + 1; |
159 |
|
reply_ptr=strchr(reply,';'); |
160 |
|
if (reply_ptr==NULL){ |
161 |
|
errf("Incorrect data returned 2"); |
163 |
|
} |
164 |
|
*reply_ptr='\0'; |
165 |
|
ihost_state->server_udp_port=atoi(reply); |
166 |
< |
reply=++reply_ptr; |
166 |
> |
reply=reply_ptr+1; |
167 |
|
ihost_state->server_tcp_port=atoi(reply); |
168 |
|
if ((ihost_state->server_tcp_port==0) || (ihost_state->server_udp_port==0)){ |
169 |
|
errf("Incorrect data returned 3 "); |
177 |
|
} |
178 |
|
|
179 |
|
if(fclose(fm_fd_r) !=0){ |
180 |
< |
errf("Failed to close FD (%m)"); |
180 |
> |
errf("Failed to close read FD (%m)"); |
181 |
|
return -1; |
182 |
|
} |
183 |
|
if(fclose(fm_fd_w) !=0){ |
184 |
< |
errf("Failed to close FD (%m)"); |
184 |
> |
errf("Failed to close write FD (%m)"); |
185 |
|
return -1; |
186 |
|
} |
187 |
|
|
273 |
|
} |
274 |
|
|
275 |
|
if(fclose(fm_fd_r) !=0){ |
276 |
< |
errf("Failed to close FD (%m)"); |
276 |
> |
errf("Failed to close read FD (%m)"); |
277 |
|
return -1; |
278 |
|
} |
279 |
|
if(fclose(fm_fd_w) !=0){ |
280 |
< |
errf("Failed to close FD (%m)"); |
280 |
> |
errf("Failed to close write FD (%m)"); |
281 |
|
return -1; |
282 |
|
} |
283 |
|
|