From 4445ba7eba97df28d27a64880c1a46b5dde9cdb0 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Sat, 16 Mar 2024 03:58:54 +0100 Subject: [PATCH] Handle 64 bit time_t on 32 bit systems --- gridftp/client/source/globus_ftp_client_perf_plugin.c | 4 ++-- gridftp/client/source/globus_ftp_client_perf_plugin.h | 2 +- .../client/source/globus_ftp_client_throughput_plugin.c | 4 ++-- .../source/test/globus_ftp_client_test_perf_plugin.c | 4 ++-- gridftp/server-lib/src/configure.ac | 4 ++-- .../server-lib/src/globus_gridftp_server_control_events.c | 4 ++-- gridftp/server/src/configure.ac | 2 +- gridftp/server/src/globus_i_gfs_control.c | 8 ++++---- packaging/debian/globus-ftp-client/debian/changelog.in | 1 + .../globus-gridftp-server-control/debian/changelog.in | 6 ++++++ .../debian/globus-gridftp-server/debian/changelog.in | 6 ++++++ packaging/fedora/globus-ftp-client.spec | 1 + packaging/fedora/globus-gridftp-server-control.spec | 5 ++++- packaging/fedora/globus-gridftp-server.spec | 5 ++++- 14 files changed, 38 insertions(+), 18 deletions(-) diff --git a/gridftp/client/source/globus_ftp_client_perf_plugin.c b/gridftp/client/source/globus_ftp_client_perf_plugin.c index cc19c7fdcf..f5d32e4ca1 100644 --- a/gridftp/client/source/globus_ftp_client_perf_plugin.c +++ b/gridftp/client/source/globus_ftp_client_perf_plugin.c @@ -177,7 +177,7 @@ perf_plugin_response_cb( char * buffer; char * tmp_ptr; int count; - long time_stamp_int; + time_t time_stamp_int; char time_stamp_tenth; int stripe_ndx; int num_stripes; @@ -301,7 +301,7 @@ perf_plugin_data_cb( { perf_plugin_info_t * ps; globus_abstime_t timebuf; - long secs; + time_t secs; long usecs; double time_now; diff --git a/gridftp/client/source/globus_ftp_client_perf_plugin.h b/gridftp/client/source/globus_ftp_client_perf_plugin.h index ffbe6e6247..98c8e52094 100644 --- a/gridftp/client/source/globus_ftp_client_perf_plugin.h +++ b/gridftp/client/source/globus_ftp_client_perf_plugin.h @@ -133,7 +133,7 @@ typedef void (*globus_ftp_client_perf_plugin_begin_cb_t)( typedef void (*globus_ftp_client_perf_plugin_marker_cb_t)( void * user_specific, globus_ftp_client_handle_t * handle, - long time_stamp_int, + time_t time_stamp_int, char time_stamp_tenth, int stripe_ndx, int num_stripes, diff --git a/gridftp/client/source/globus_ftp_client_throughput_plugin.c b/gridftp/client/source/globus_ftp_client_throughput_plugin.c index 3a32bdc20e..a3976b1f37 100644 --- a/gridftp/client/source/globus_ftp_client_throughput_plugin.c +++ b/gridftp/client/source/globus_ftp_client_throughput_plugin.c @@ -103,7 +103,7 @@ throughput_plugin_begin_cb( { throughput_plugin_info_t * info; globus_abstime_t timebuf; - long secs; + time_t secs; long usecs; globus_ftp_client_restart_marker_t marker; globus_off_t total_bytes; @@ -157,7 +157,7 @@ void throughput_plugin_marker_cb( void * user_specific, globus_ftp_client_handle_t * handle, - long time_stamp_int, + time_t time_stamp_int, char time_stamp_tenth, int stripe_ndx, int num_stripes, diff --git a/gridftp/client/source/test/globus_ftp_client_test_perf_plugin.c b/gridftp/client/source/test/globus_ftp_client_test_perf_plugin.c index 5fdbcab7ae..59c566a45c 100644 --- a/gridftp/client/source/test/globus_ftp_client_test_perf_plugin.c +++ b/gridftp/client/source/test/globus_ftp_client_test_perf_plugin.c @@ -60,14 +60,14 @@ static void perf_plugin_marker_cb( void * user_specific, globus_ftp_client_handle_t * handle, - long time_stamp_int, + time_t time_stamp_int, char time_stamp_tenth, int stripe_ndx, int num_stripes, globus_off_t nbytes) { globus_libc_fprintf(stderr, "perf_plugin_marker_cb\n"); - globus_libc_fprintf(stderr, "time_stamp %ld.%d\n", time_stamp_int, time_stamp_tenth); + globus_libc_fprintf(stderr, "time_stamp %lld.%d\n", (long long) time_stamp_int, time_stamp_tenth); globus_libc_fprintf(stderr, "stripe_ndx %d\n", stripe_ndx); globus_libc_fprintf(stderr, "num_stripes %d\n", num_stripes); globus_libc_fprintf(stderr, "nbytes %" GLOBUS_OFF_T_FORMAT "\n", nbytes); diff --git a/gridftp/server-lib/src/configure.ac b/gridftp/server-lib/src/configure.ac index e7f6dde4df..34e4b23bba 100644 --- a/gridftp/server-lib/src/configure.ac +++ b/gridftp/server-lib/src/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.60]) -AC_INIT([globus_gridftp_server_control],[9.3],[https://github.com/gridcf/gct/issues]) +AC_INIT([globus_gridftp_server_control],[9.4],[https://github.com/gridcf/gct/issues]) AC_CONFIG_MACRO_DIR([m4]) AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}]) AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}]) @@ -21,6 +21,6 @@ AC_CONFIG_FILES( globus-gridftp-server-control.pc globus-gridftp-server-control-uninstalled.pc Makefile - version.h + version.h test/Makefile) AC_OUTPUT diff --git a/gridftp/server-lib/src/globus_gridftp_server_control_events.c b/gridftp/server-lib/src/globus_gridftp_server_control_events.c index 17f9b18001..a78563734e 100644 --- a/gridftp/server-lib/src/globus_gridftp_server_control_events.c +++ b/gridftp/server-lib/src/globus_gridftp_server_control_events.c @@ -339,12 +339,12 @@ globus_l_gsc_send_perf( gettimeofday(&now, NULL); msg = globus_common_create_string( "112-Perf Marker\r\n" - " Timestamp: %ld.%01ld\r\n" + " Timestamp: %lld.%01ld\r\n" " Stripe Index: %d\r\n" " Stripe Bytes Transferred: %"GLOBUS_OFF_T_FORMAT"\r\n" " Total Stripe Count: %d\r\n" "112 End.\r\n", - now.tv_sec, now.tv_usec / 100000, + (long long) now.tv_sec, now.tv_usec / 100000, stripe_ndx, nbytes, stripe_count); diff --git a/gridftp/server/src/configure.ac b/gridftp/server/src/configure.ac index cfdf9a847b..577d9b1837 100644 --- a/gridftp/server/src/configure.ac +++ b/gridftp/server/src/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.60]) -AC_INIT([globus_gridftp_server],[13.26],[https://github.com/gridcf/gct/issues]) +AC_INIT([globus_gridftp_server],[13.27],[https://github.com/gridcf/gct/issues]) AC_CONFIG_MACRO_DIR([m4]) AC_SUBST([MAJOR_VERSION], [${PACKAGE_VERSION%%.*}]) AC_SUBST([MINOR_VERSION], [${PACKAGE_VERSION##*.}]) diff --git a/gridftp/server/src/globus_i_gfs_control.c b/gridftp/server/src/globus_i_gfs_control.c index 7e75f9b2fd..450330284a 100644 --- a/gridftp/server/src/globus_i_gfs_control.c +++ b/gridftp/server/src/globus_i_gfs_control.c @@ -1061,11 +1061,11 @@ globus_l_gfs_data_command_cb( gettimeofday(&now, NULL); msg = globus_common_create_string( "%d-Status Marker\r\n" - " Timestamp: %ld.%01ld\r\n" + " Timestamp: %lld.%01ld\r\n" " Bytes Processed: %s\r\n" "%d End.\r\n", reply->code, - now.tv_sec, now.tv_usec / 100000, + (long long) now.tv_sec, now.tv_usec / 100000, reply->info.command.checksum, reply->code); globus_i_gsc_cmd_intermediate_reply(op, msg); @@ -1098,12 +1098,12 @@ globus_l_gfs_data_command_cb( case 112: msg = globus_common_create_string( "112-Perf Marker\r\n" - " Timestamp: %ld.%01ld\r\n" + " Timestamp: %lld.%01ld\r\n" " Stripe Index: 0\r\n" " Stripe Bytes Transferred: %s\r\n" " Total Stripe Count: 1\r\n" "112 End.\r\n", - now.tv_sec, now.tv_usec / 100000, + (long long) now.tv_sec, now.tv_usec / 100000, reply->info.command.checksum); break; default: diff --git a/packaging/debian/globus-ftp-client/debian/changelog.in b/packaging/debian/globus-ftp-client/debian/changelog.in index a08929e63f..f9bd3a1f70 100644 --- a/packaging/debian/globus-ftp-client/debian/changelog.in +++ b/packaging/debian/globus-ftp-client/debian/changelog.in @@ -1,6 +1,7 @@ globus-ftp-client (9.9-1+gct.@distro@) @distro@; urgency=medium * Fix format warnings on 32 bit systems + * Handle 64 bit time_t on 32 bit systems -- Mattias Ellert Fri, 01 Mar 2024 11:13:14 +0100 diff --git a/packaging/debian/globus-gridftp-server-control/debian/changelog.in b/packaging/debian/globus-gridftp-server-control/debian/changelog.in index 90c40792a5..f00b88bbb4 100644 --- a/packaging/debian/globus-gridftp-server-control/debian/changelog.in +++ b/packaging/debian/globus-gridftp-server-control/debian/changelog.in @@ -1,3 +1,9 @@ +globus-gridftp-server-control (9.4-1+gct.@distro@) @distro@; urgency=medium + + * Handle 64 bit time_t on 32 bit systems + + -- Mattias Ellert Sat, 16 Mar 2024 03:38:32 +0100 + globus-gridftp-server-control (9.3-1+gct.@distro@) @distro@; urgency=medium * Fix some compiler warnings diff --git a/packaging/debian/globus-gridftp-server/debian/changelog.in b/packaging/debian/globus-gridftp-server/debian/changelog.in index 40aa19be21..2f19323df4 100644 --- a/packaging/debian/globus-gridftp-server/debian/changelog.in +++ b/packaging/debian/globus-gridftp-server/debian/changelog.in @@ -1,3 +1,9 @@ +globus-gridftp-server (13.27-1+gct.@distro@) @distro@; urgency=medium + + * Handle 64 bit time_t on 32 bit systems + + -- Mattias Ellert Sat, 16 Mar 2024 03:39:44 +0100 + globus-gridftp-server (13.26-1+gct.@distro@) @distro@; urgency=medium * Correct spelling error found by lintian diff --git a/packaging/fedora/globus-ftp-client.spec b/packaging/fedora/globus-ftp-client.spec index eb4f3b4ef5..b56a93c6dc 100644 --- a/packaging/fedora/globus-ftp-client.spec +++ b/packaging/fedora/globus-ftp-client.spec @@ -171,6 +171,7 @@ GLOBUS_HOSTNAME=localhost make %{?_smp_mflags} check VERBOSE=1 %changelog * Fri Mar 01 2024 Mattias Ellert - 9.9-1 - Fix format warnings on 32 bit systems +- Handle 64 bit time_t on 32 bit systems * Wed Mar 09 2022 Mattias Ellert - 9.8-1 - Fix some compiler and doxygen warnings diff --git a/packaging/fedora/globus-gridftp-server-control.spec b/packaging/fedora/globus-gridftp-server-control.spec index b492e36b80..aaf005de1e 100644 --- a/packaging/fedora/globus-gridftp-server-control.spec +++ b/packaging/fedora/globus-gridftp-server-control.spec @@ -3,7 +3,7 @@ Name: globus-gridftp-server-control %global soname 0 %global _name %(echo %{name} | tr - _) -Version: 9.3 +Version: 9.4 Release: 1%{?dist} Summary: Grid Community Toolkit - Globus GridFTP Server Library @@ -112,6 +112,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la %{_libdir}/pkgconfig/%{name}.pc %changelog +* Sat Mar 16 2024 Mattias Ellert - 9.4-1 +- Handle 64 bit time_t on 32 bit systems + * Thu Mar 10 2022 Mattias Ellert - 9.3-1 - Fix some compiler warnings diff --git a/packaging/fedora/globus-gridftp-server.spec b/packaging/fedora/globus-gridftp-server.spec index 8c1f65d7f1..a821f2d8a0 100644 --- a/packaging/fedora/globus-gridftp-server.spec +++ b/packaging/fedora/globus-gridftp-server.spec @@ -3,7 +3,7 @@ Name: globus-gridftp-server %global soname 6 %global _name %(echo %{name} | tr - _) -Version: 13.26 +Version: 13.27 Release: 1%{?dist} Summary: Grid Community Toolkit - Globus GridFTP Server @@ -223,6 +223,9 @@ fi %{_libdir}/pkgconfig/%{name}.pc %changelog +* Sat Mar 16 2024 Mattias Ellert - 13.27-1 +- Handle 64 bit time_t on 32 bit systems + * Fri Mar 08 2024 Mattias Ellert - 13.26-1 - Correct spelling error found by lintian