diff options
| author | pengxuanzheng <[email protected]> | 2021-10-22 18:02:23 +0800 |
|---|---|---|
| committer | pengxuanzheng <[email protected]> | 2021-10-22 18:02:23 +0800 |
| commit | 400c33e92eddfa0e54ed093ce9a23380789c34a9 (patch) | |
| tree | 74a70ebc419410f6261860f8070db2d89d2c9a49 /example/performance | |
| parent | 88a8dccbd099b7077df2a7a236cd985c6cfe6c84 (diff) | |
🐞 fix(TSG-8143): 区分hos_open_fd的错误值以及fd的值,不再共用一个返回值v3.0.1
Diffstat (limited to 'example/performance')
| -rw-r--r-- | example/performance/HosClientPerformance.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/example/performance/HosClientPerformance.cpp b/example/performance/HosClientPerformance.cpp index 59366474..8341d507 100644 --- a/example/performance/HosClientPerformance.cpp +++ b/example/performance/HosClientPerformance.cpp @@ -122,6 +122,7 @@ static int upload_file(char *file, char *buff, int buff_len, thread_info_t *thre double variance = 0.00; double average = 0.00; long time = 0; + int err = 0; //写文件 //clock_gettime(CLOCK_MONOTONIC, &tstart); @@ -154,7 +155,7 @@ static int upload_file(char *file, char *buff, int buff_len, thread_info_t *thre for (i = 0; i < g_test_count; i++) { clock_gettime(CLOCK_MONOTONIC, &tstart); - fd[i] = hos_open_fd(thread_info->bucket, thread_info->object, callback, NULL, thread_info->thread_num); + err = hos_open_fd(thread_info->bucket, thread_info->object, callback, NULL, thread_info->thread_num, &fd[i]); if (hos_write(fd[i], file, 0) != HOS_CLIENT_OK) { printf("error:hos_write file:%s\n", file); @@ -210,10 +211,11 @@ static int upload_buff(char * buff, int buff_len, thread_info_t *thread_info, ch double variance = 0.00; double average = 0.00; long record[30000] = {0}; + int err = 0; if (g_mode & APPEND_MODE) { - fd[0] = hos_open_fd(thread_info->bucket, thread_info->object, callback, NULL, thread_info->thread_num); + err = hos_open_fd(thread_info->bucket, thread_info->object, callback, NULL, thread_info->thread_num, &fd[0]); for (i = 0; i < g_test_count; i++) { |
