Wolfgang Stöggl [Fri, 18 Jan 2019 17:05:47 +0000 (18:05 +0100)]
Fix: Cannot rename temporary file to final file
- Fixes the following failing tests under Windows:
modify1, modify2, modify3, modify4, modify5
- Use CreateFileA() with FILE_SHARE_DELETE in rrd_open.c,
so that the outfilename can later be replaced by tmpfilename using
write_rrd() in rrd_create.c
Wolfgang Stöggl [Tue, 15 Jan 2019 09:44:39 +0000 (10:44 +0100)]
Define realpath for MinGW builds
- Define realpath the same way as in win32/rrd_config.h
- Fixes the following compiler warnings in rrd_client.c:
115:11: warning: implicit declaration of function 'realpath';
[-Wimplicit-function-declaration] ret = realpath(path, NULL);
115:11: warning: nested extern declaration of 'realpath'
[-Wnested-externs]
115:9: warning: assignment to 'char *' from 'int' makes pointer from
integer without a cast [-Wint-conversion] ret = realpath(path, NULL);
132:22: warning: assignment to 'char *' from 'int' makes pointer from
integer without a cast [-Wint-conversion]
dir_path = realpath(dir, NULL);
Wolfgang Stöggl [Wed, 16 Jan 2019 08:17:43 +0000 (09:17 +0100)]
Remove LINKTYPE from perl-piped/Makefile.PL
- Remove line:
'linkext' => {LINKTYPE => ''},
Since version 5.00 of MakeMaker such a line can be deleted safely.
MakeMaker recognizes when there's nothing to be linked.
See: https://perldoc.perl.org/ExtUtils/MakeMaker.html
- Fixes Warning:
LINKTYPE set to '', no longer necessary
Wolfgang Stöggl [Thu, 10 Jan 2019 16:06:21 +0000 (17:06 +0100)]
Use g_list_free_full instead of g_list_foreach
- Fixes the following compiler warnings in rrd_create.c:
236:34: warning: cast between incompatible function types from
'void (*)(void *)' to 'void (*)(void *, void *)'
[-Wcast-function-type] g_list_foreach( sources, (GFunc)free, NULL );
1022:44: warning: cast between incompatible function types from
'void (*)(rrd_file_t *)' {aka 'void (*)(struct rrd_file_t *)'} to
'void (*)(void *, void *)' [-Wcast-function-type]
g_list_foreach(sources_rrd_files, (GFunc) cleanup_source_file, NULL);
Wolfgang Stöggl [Thu, 10 Jan 2019 13:39:37 +0000 (14:39 +0100)]
Remove function substring from rrd_graph.c
- The function substring is not used any more. This was a leftover
from https://github.com/oetiker/rrdtool-1.x/commit/cd4a728
- Fixes rrd_graph.c:6159:7: warning:
no previous prototype for 'substring' [-Wmissing-prototypes]
*** WARNING: line containing nothing but whitespace in paragraph at line 46 in file PDP_calculation_explanation.pod
*** ERROR: Apparent command =head1 not preceded by blank line at line 176 in file PDP_calculation_explanation.pod
*** WARNING: node 'https://gallery.technet.microsoft.com/scriptcenter/Sample-Script-to-Generate-59c80d4c =head1 AUTHOR' contains non-escaped | or / at line 175 in file PDP_calculation_explanation.pod
*** ERROR: unresolved internal link 'https://gallery.technet.microsoft.com/scriptcenter/Sample-Script-to-Generate-59c80d4c =head1 AUTHOR' at line 175 in file PDP_calculation_explanation.pod
PDP_calculation_explanation.pod has 2 pod syntax errors.
Wolfgang Stöggl [Tue, 18 Dec 2018 16:23:06 +0000 (17:23 +0100)]
Add -lws2_32 for MinGW builds by configure
- Add -lws2_32 to LIBS in case of MinGW or MinGW-w64 builds.
This makes building Windows executables more straightforward using
configure.
- Update README-MinGW-w64, remove LIBS='-lws2_32' from configure
instructions.
Wolfgang Stöggl [Tue, 18 Dec 2018 10:57:22 +0000 (11:57 +0100)]
Check for gobject-2.0 in configure
- Since pango version 1.43.0, -lgobject-2.0 is not added automatically
any more during configure. Remark: pango.pc uses Requires.private
now for gobject-2.0 instead of formerly Requires: gobject-2.0
- Check for gobject-2.0 in configure to make sure, that -lgobject-2.0
is added to ALL_LIBS
- Fixes the following linker errors:
.libs/librrd_la-rrd_graph.o: In function `im_free':
src/rrd_graph.c:465: undefined reference to `g_object_unref'
.libs/librrd_la-rrd_graph.o: In function `rrd_graph_init':
src/rrd_graph.c:4840: undefined reference to `g_object_unref'
Wolfgang Stöggl [Thu, 29 Nov 2018 11:21:06 +0000 (12:21 +0100)]
Fix tests to support Windows time zone name
- On Windows, names of times zones are different.
Substitute 'W. Europe Standard Time' with 'CET' by function seddif
- Removes unnecessary diff output and fixes therefore failing tests
Wolfgang Stöggl [Wed, 7 Nov 2018 15:25:37 +0000 (16:25 +0100)]
Add windows-default-manifest to README-MinGW-w64
- windows-default-manifest is available for Fedora in the meantime.
This adds a default manifest to the compiled binaries and prevents
unnecessary elevated privileges, e.g. for 32-bit rrdupdate.exe
Wolfgang Stöggl [Wed, 26 Sep 2018 12:59:20 +0000 (14:59 +0200)]
Update perl-shared README for MSVC and ActivePerl
- Using MSVC, the last supported ActivePerl version is 5.16,
e.g. ActivePerl-5.16.3.1604-MSWin32-x86-298023.msi
- Since 5.18, ActivePerl is compiled with GCC compilers, and Microsoft
toolchains are *not* compatible
- See this FAQ for further details:
https://community.activestate.com/faq/windows-compilers-perl-modules
Karl Palsson [Fri, 17 Aug 2018 07:51:40 +0000 (07:51 +0000)]
lua: don't include rrd_restore if it wasn't included (#901)
The lua module compiles ok, but fails to load.
> rrd=require("rrd")
error loading module 'rrd' from file '/usr/lib/lua/rrd.so':
Error relocating /usr/lib/lua/rrd.so: rrd_restore: symbol not found
stack traceback:
[C]: ?
[C]: in function 'require'
Wolfgang Stöggl [Sat, 14 Jul 2018 12:31:06 +0000 (14:31 +0200)]
Fix lastupdate time in dump (32bit MSVC only)
- So far, (null) was written into the lastupdate time string:
e.g.: <lastupdate>1511170870</lastupdate> <!-- (null) -->
- The problem occurred only in 32bit MSVC builds
- Works for both, with or without _USE_32BIT_TIME_T
bindings: python: Fix race conditions at arguments access
rrdtool_argv and rrdtool_argc have to be allocated at each function stack in
order to have copy of variables for each running thread. Note that we call
librrd functions with GIL unlocked, so previously there was simultaneous access
to global rrdtool_argv and rrdtool_argc variables.
Fixes: 8949308812a0 ("Unlock the global thread lock while processing rrd") Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Wolfgang Stöggl [Tue, 2 Jan 2018 10:04:40 +0000 (11:04 +0100)]
Fix expansion-to-defined warnings (GCC 7)
- Fixed compiler warnings:
gettext.h:176:6: warning: this use of "defined" may not be portable
[-Wexpansion-to-defined] #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
gettext.h:200:5: warning: this use of "defined" may not be portable
[-Wexpansion-to-defined] #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
gettext.h:215:6: warning: this use of "defined" may not be portable
[-Wexpansion-to-defined] #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
gettext.h:246:5: warning: this use of "defined" may not be portable
[-Wexpansion-to-defined] #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
gettext.h:261:6: warning: this use of "defined" may not be portable
[-Wexpansion-to-defined] #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
Wolfgang Stöggl [Sun, 31 Dec 2017 13:38:29 +0000 (14:38 +0100)]
Fix 64-bit time_t in fprintf, printf (MSVC)
- In VS2005 and later, the default size for time_t is 64-bit, unless
_USE_32BIT_TIME_T has been defined to use a 32-bit time_t ...
- Fixes MSVC compiler warnings:
./src\rrd_graph_helper.c(1465): warning C4477: 'fprintf' :
format string '%li' requires an argument of type 'long',
but variadic argument 1 has type 'time_t'
./src\rrd_lastupdate.c(83): warning C4477: 'printf' :
format string '%10lu' requires an argument of type 'unsigned long',
but variadic argument 1 has type 'time_t'
./src\rrd_tool.c(720): warning C4477: 'printf' : format string '%ld'
requires an argument of type 'long', but variadic argument 1 has type
'time_t'
./src\rrd_tool.c(724): warning C4477: 'printf' : format string '%ld'
requires an argument of type 'long', but variadic argument 1 has type
'time_t'
./src\rrd_tool.c(742): warning C4477: 'printf' : format string
'%10lu' requires an argument of type 'unsigned long', but variadic
argument 1 has type 'time_t'
Wolfgang Stöggl [Tue, 26 Dec 2017 05:57:53 +0000 (06:57 +0100)]
Check for MinGW-w64 build, add win32-glob files
- configure.ac: Add check for MinWG-w64 build during configure.
Pass the conditional MINGW_W64 to automake
- src/Makefile.am: Add win32-glob.c to RRD_C_FILES and
win32-glob.h to noinst_HEADERS in case of MINGW_W64
- Enables out of the box configure and make for MinGW-w64 builds
Wolfgang Stöggl [Thu, 14 Dec 2017 20:10:11 +0000 (21:10 +0100)]
Fix compiler warnings, llu lli 64bit (MinGW-w64)
- time_t is of type 'long long int', when compiled for 64 bit Windows
(x86_64-w64-mingw32). Use %10llu instead of %10lu in printf and
%lli instead of %li in dprintf. Requires __USE_MINGW_ANSI_STDIO 1
- Fixes: rrd_lastupdate.c: In function 'rrd_lastupdate':
rrd_lastupdate.c:76:18:
warning: format '%lu' expects argument of type 'long unsigned int',
but argument 2 has type 'time_t {aka long long int}' [-Wformat=]
- Fixes: rrd_graph_helper.c: In function 'parse_shift':
rrd_graph_helper.c:1458:13:
warning: format '%li' expects argument of type 'long int',
but argument 3 has type 'time_t {aka long long int}' [-Wformat=]
dprintf("SHIFTBY : %li\n",gdp->shval);
Wolfgang Stöggl [Thu, 7 Dec 2017 20:43:53 +0000 (21:43 +0100)]
Fix ctime_r configure error (MinGW-w64)
- configure.ac: include pthread.h inside AC_LANG_PROGRAM
for ctime_r check if __MINGW32__ is defined
Fixes:
checking if ctime_r need special care to act posixly correct...
configure: error: Can't figure how to compile ctime_r
Wolfgang Stöggl [Wed, 6 Dec 2017 10:55:04 +0000 (11:55 +0100)]
Fix further build errors (MinGW-w64)
- rrd_list.c: MinGW-w64 does not provide glob.h (yet?)
include win32/win32-glob.h using HAVE_GLOB_H. Fixes:
rrd_list.c:9:10: fatal error: glob.h: No such file or directory
#include <glob.h>
- rrd_update.c: MinGW has gettimeofday() in time.h. Fixes:
rrd_update.c:46:12: error: conflicting types for 'gettimeofday'
static int gettimeofday(
- rrd_tool.c: MinGW has not got getuid and mkdir only one argument.
Fixes:
rrd_tool.c:585:17: warning: nested extern declaration of 'getuid'
rrd_tool.c:632:16: error: too many arguments to function 'mkdir'
if(mkdir(argv[2], 0777)!=0){
- rrd_tool.h:
MinGW-w64 provides localtime_r, ctime_r, gmtime_r, strtok_r
- rrd_graph.c: MinGW has strftime and tzname.
Due to the resulting later include of time.h, fixes also:
rrd_graph.c:1558: undefined reference to `localtime_r'
- rrd_client.c: MinGW does not provide realpath, "is_unix" excluded.
Fixes:
rrd_client.c:113: undefined reference to `realpath'
rrd_client.c:130: undefined reference to `realpath'
- rrd_rpncalc.c: include pthread.h. Fixes e.g.:
rrd_rpncalc.c:708: undefined reference to `localtime_r'