remove compile warnings
(cherry picked from commit e16a01edad1ffb04d89b42bccf9090c29d81815f)
This commit is contained in:
parent
4e1a26c890
commit
e7128c6d8b
80
0001-remove-compile-warnings-in-client-and-storage.patch
Normal file
80
0001-remove-compile-warnings-in-client-and-storage.patch
Normal file
@ -0,0 +1,80 @@
|
||||
From 75c5535f5a9853dfe8302cd5852bb36bc518fde5 Mon Sep 17 00:00:00 2001
|
||||
From: YuQing <384681@qq.com>
|
||||
Date: Mon, 11 Mar 2024 15:25:41 +0800
|
||||
Subject: [PATCH] remove compile warnings
|
||||
|
||||
---
|
||||
client/storage_client.c | 23 +++++++++++++----------
|
||||
storage/storage_service.c | 2 +-
|
||||
2 files changed, 14 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/client/storage_client.c b/client/storage_client.c
|
||||
index 5acfa9b..6f05742 100644
|
||||
--- a/client/storage_client.c
|
||||
+++ b/client/storage_client.c
|
||||
@@ -919,7 +919,7 @@ int storage_do_upload_file(ConnectionInfo *pTrackerServer, \
|
||||
char in_buff[128];
|
||||
char *pInBuff;
|
||||
ConnectionInfo storageServer;
|
||||
- bool new_connection;
|
||||
+ bool new_connection = false;
|
||||
bool bUploadSlave;
|
||||
int new_store_path;
|
||||
int master_filename_len;
|
||||
@@ -948,19 +948,22 @@ int storage_do_upload_file(ConnectionInfo *pTrackerServer, \
|
||||
bUploadSlave = (strlen(group_name) > 0 && master_filename_len > 0);
|
||||
if (bUploadSlave)
|
||||
{
|
||||
- if ((result=storage_get_update_connection(pTrackerServer, \
|
||||
- &pStorageServer, group_name, master_filename, \
|
||||
+ if ((result=storage_get_update_connection(pTrackerServer,
|
||||
+ &pStorageServer, group_name, master_filename,
|
||||
&storageServer, &new_connection)) != 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
- else if ((result=storage_get_upload_connection(pTrackerServer, \
|
||||
- &pStorageServer, group_name, &storageServer, \
|
||||
- &new_store_path, &new_connection)) != 0)
|
||||
+ else
|
||||
{
|
||||
- *group_name = '\0';
|
||||
- return result;
|
||||
+ if ((result=storage_get_upload_connection(pTrackerServer,
|
||||
+ &pStorageServer, group_name, &storageServer,
|
||||
+ &new_store_path, &new_connection)) != 0)
|
||||
+ {
|
||||
+ *group_name = '\0';
|
||||
+ return result;
|
||||
+ }
|
||||
}
|
||||
|
||||
*group_name = '\0';
|
||||
@@ -1264,8 +1267,8 @@ int storage_set_metadata(ConnectionInfo *pTrackerServer, \
|
||||
char *pEnd;
|
||||
bool new_connection;
|
||||
|
||||
- if ((result=storage_get_update_connection(pTrackerServer, \
|
||||
- &pStorageServer, group_name, filename, \
|
||||
+ if ((result=storage_get_update_connection(pTrackerServer,
|
||||
+ &pStorageServer, group_name, filename,
|
||||
&storageServer, &new_connection)) != 0)
|
||||
{
|
||||
return result;
|
||||
diff --git a/storage/storage_service.c b/storage/storage_service.c
|
||||
index 0a0ae82..5eea899 100644
|
||||
--- a/storage/storage_service.c
|
||||
+++ b/storage/storage_service.c
|
||||
@@ -1783,7 +1783,7 @@ void storage_get_store_path(const char *filename, const int filename_len, \
|
||||
{ \
|
||||
int r; \
|
||||
r = (rand() & 0x007FFFFF) | 0x80000000; \
|
||||
- masked_file_size = (((int64_t)r) << 32 ) | file_size; \
|
||||
+ masked_file_size = (((int64_t)r) << 32 ) | (file_size); \
|
||||
} while (0)
|
||||
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
Name: fastdfs
|
||||
Version: 6.12.0
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: FastDFS server and client
|
||||
License: GPL3.0
|
||||
Group: Arch/Tech
|
||||
URL: https://github.com/happyfish100/fastdfs
|
||||
Source: https://github.com/happyfish100/fastdfs/archive/V%{version}.tar.gz
|
||||
|
||||
Patch1: 0001-remove-compile-warnings-in-client-and-storage.patch
|
||||
|
||||
Requires: gcc cmake
|
||||
BuildRequires: libfastcommon-devel >= 1.0.66
|
||||
BuildRequires: libserverframe-devel >= 1.2.1
|
||||
@ -55,7 +57,7 @@ FastDFS config files for sample
|
||||
commit version: $COMMIT_VERSION
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
%build
|
||||
./make.sh clean && ./make.sh
|
||||
@ -110,6 +112,9 @@ rm -rf %{buildroot}
|
||||
%config(noreplace) /etc/fdfs/*.conf
|
||||
|
||||
%changelog
|
||||
* Fri Aug 2 2024 zhangyaqi <zhangyaqi@kylinos.cn> - 6.12.0-2
|
||||
- remove compile warnings
|
||||
|
||||
* Mon Feb 26 2024 liweigang <izmirvii@gmail.com> - 6.12.0-1
|
||||
- update to version 6.12.0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user