- Timestamp:
- Feb 24, 2012, 2:28:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/CopyToHostLocation.c
r33368 r33369 92 92 valid: 93 93 // read srcname, write to tgtname, get MD5 sum for srcname as we go: 94 // XXX files that fail here should be skipped (but don't give up) 94 95 if (!get_md5_with_copy (srcname, tgtname, srcDigest)) { 95 96 fprintf (stderr, "error reading %s, getting md5, or writing %s\n", srcname, tgtname); … … 99 100 100 101 // need to re-open and re-read tgtname to check md5sum 102 // XXX files that fail here need to be checked 101 103 char *absname = abspath (tgtname, 1024); 102 104 if (!get_md5_from_pclient (host, absname, tgtDigest)) { … … 233 235 // fprintf (stderr, "command: %s\n", line); 234 236 235 // start the md5sum command236 237 InitIOBuffer (&buffer, 100); 237 PclientCommand (host, line, &buffer);238 PclientResponse (host, PCLIENT_PROMPT, &buffer);239 // XXX for the moment, abort if anything goes wrong240 241 // wait for result242 238 InitIOBuffer (&stdout_buf, 100); 243 239 InitIOBuffer (&stderr_buf, 100); 240 241 // need to reset pclient for next command... 242 if (!PclientCommand (host, "reset", &buffer)) goto escape; 243 if (!PclientResponse (host, PCLIENT_PROMPT, &buffer)) goto escape; 244 FlushIOBuffer (&buffer); 245 246 // start the md5sum command 247 if (!PclientCommand (host, line, &buffer)) goto escape; 248 if (!PclientResponse (host, PCLIENT_PROMPT, &buffer)) goto escape; 249 // XXX for the moment, abort if anything goes wrong 250 251 // wait for result 244 252 while (!CheckBusyJob (host, &stdout_buf, &stderr_buf)) { 253 FlushIOBuffer (&stdout_buf); 254 FlushIOBuffer (&stdout_buf); 245 255 usleep (10000); 246 256 } 247 257 if (stderr_buf.Nbuffer) { 248 258 fprintf (stderr, "error in md5sum: %s\n", stderr_buf.buffer); 249 exit (1);259 goto escape; 250 260 } 251 261 … … 267 277 268 278 // need to reset pclient for next command... 269 PclientCommand (host, "reset", &buffer);270 PclientResponse (host, PCLIENT_PROMPT, &buffer);279 if (!PclientCommand (host, "reset", &buffer)) goto escape; 280 if (!PclientResponse (host, PCLIENT_PROMPT, &buffer)) goto escape; 271 281 272 282 return TRUE; 283 284 escape: 285 FreeIOBuffer (&buffer); 286 FreeIOBuffer (&stdout_buf); 287 FreeIOBuffer (&stderr_buf); 288 return FALSE; 273 289 } 274 290
Note:
See TracChangeset
for help on using the changeset viewer.
