From: kh5325.kim Date: Mon, 1 Jul 2013 15:22:23 +0000 (+0900) Subject: Upload tizen_2.2 source X-Git-Tag: 2.2.1_release~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ca9f1b56b0509378c2e25de912e6f6ddf13a883;p=sdk%2Ftools%2Fsdb.git Upload tizen_2.2 source Change-Id: I84adf3c520cabaa8b1d8aa4d2590246818f5159b --- diff --git a/src/file_sync_client.c b/src/file_sync_client.c index 0850832..3a68b8d 100644 --- a/src/file_sync_client.c +++ b/src/file_sync_client.c @@ -100,8 +100,9 @@ static int file_copy(int src_fd, int dst_fd, char* srcp, char* dstp, FILE_FUNC* return -1; } } - srcF->readclose(src_fd); - dstF->writeclose(dst_fd, dstp, srcstat); + if(srcF->readclose(src_fd) < 0 || dstF->writeclose(dst_fd, dstp, srcstat) < 0) { + return -1; + } free(srcstat); return 1; } @@ -170,10 +171,7 @@ int do_sync_copy(char* srcp, char* dstp, FILE_FUNC* srcF, FILE_FUNC* dstF, int i } } int result = file_copy(src_fd, dst_fd, srcp, dstp, srcF, dstF, &total_bytes); - if(result < 0) { - finalize(src_fd, dst_fd, srcF, dstF); - return 1; - } + if(result == 1) { pushed++; } @@ -232,10 +230,7 @@ int do_sync_copy(char* srcp, char* dstp, FILE_FUNC* srcF, FILE_FUNC* dstF, int i if(src_dir == 0) { fprintf(stderr,"push: %s -> %s\n", src_p, dst_p); int result = file_copy(src_fd, dst_fd, src_p, dst_p, srcF, dstF, &total_bytes); - if(result < 0) { - finalize(src_fd, dst_fd, srcF, dstF); - return 1; - } + if(result == 1) { pushed++; } @@ -257,13 +252,14 @@ int do_sync_copy(char* srcp, char* dstp, FILE_FUNC* srcF, FILE_FUNC* dstF, int i } } - char command[6] = {'p', 'u', 's', 'h', 'e', 'd'}; if(srcF == &REMOTE_FILE_FUNC) { - strncpy(command, "pulled", sizeof command); + fprintf(stderr,"%d file(s) %s. %d file(s) skipped.\n", + pushed, "pulled", skiped); + } + else { + fprintf(stderr,"%d file(s) %s. %d file(s) skipped.\n", + pushed, "pushed", skiped); } - - fprintf(stderr,"%d file(s) %s. %d file(s) skipped.\n", - pushed, command, skiped); long long end_time = NOW() - start_time; diff --git a/src/file_sync_functions.c b/src/file_sync_functions.c index b0e9796..bd2a8ea 100644 --- a/src/file_sync_functions.c +++ b/src/file_sync_functions.c @@ -292,7 +292,7 @@ int writeclose_remote(int fd, char* dstp, void* stat) { len = 255; } if(readx(fd, buf, len)) { - fprintf(stderr, "cannot close remote file '%s' and its failed msg. %s\n", dstp, strerror(errno)); + fprintf(stderr, "cannot close remote file '%s' and its failed msg.\n", dstp); return -1; } buf[len] = 0; @@ -300,7 +300,7 @@ int writeclose_remote(int fd, char* dstp, void* stat) { strcpy(buf, "unknown reason"); } - fprintf(stderr,"cannot close remote file '%s' with failed msg '%s'. %s\n", dstp, buf, strerror(errno)); + fprintf(stderr,"cannot close remote file '%s' with failed msg '%s'.\n", dstp, buf); return -1; }