From: <tak...@us...> - 2014-02-27 15:28:52
|
Revision: 8912 http://sourceforge.net/p/gfarm/code/8912 Author: takuya-i Date: 2014-02-27 15:28:48 +0000 (Thu, 27 Feb 2014) Log Message: ----------- merge r8911 from the 2.5 branch. * fix #747 - gfpcopy: an invalid file remains after gfs_pio_close() or close() failed. * fix a wrong message. Revision Links: -------------- http://sourceforge.net/p/gfarm/code/8911 Modified Paths: -------------- gfarm_v2/branches/2.6/gftool/gfprep/gfarm_pfunc.c Modified: gfarm_v2/branches/2.6/gftool/gfprep/gfarm_pfunc.c =================================================================== --- gfarm_v2/branches/2.6/gftool/gfprep/gfarm_pfunc.c 2014-02-27 15:16:43 UTC (rev 8911) +++ gfarm_v2/branches/2.6/gftool/gfprep/gfarm_pfunc.c 2014-02-27 15:28:48 UTC (rev 8912) @@ -616,7 +616,7 @@ e = pfunc_close(&src_fp); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "ERROR: copy failed: close(%s): %s\n", - tmp_url, gfarm_error_string(e)); + src_url, gfarm_error_string(e)); result = PFUNC_RESULT_NG; } e = pfunc_close(&dst_fp); @@ -625,6 +625,8 @@ tmp_url, gfarm_error_string(e)); result = PFUNC_RESULT_NG; } + if (result == PFUNC_RESULT_NG) + goto end; /* handle->skip_existing: This is race condition here. */ @@ -633,12 +635,14 @@ fprintf(stderr, "ERROR: copy failed: utime(%s): %s\n", tmp_url, gfarm_error_string(e)); result = PFUNC_RESULT_NG; + goto end; } e = pfunc_rename(tmp_url, dst_url); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "ERROR: copy failed: rename(%s -> %s): %s\n", tmp_url, dst_url, gfarm_error_string(e)); result = PFUNC_RESULT_NG; + goto end; } /* XXX pfunc_mode == PFUNC_MODE_MIGRATE : unlink src_url */ end: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |