]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/log
thirdparty/rrdtool-1.x.git
2 years agoMerge branch 'master' into 2021-07-13_Add_escapeJSON_to_legend_entries 1125/head
Tobias Oetiker [Wed, 14 Jul 2021 16:03:01 +0000 (18:03 +0200)] 
Merge branch 'master' into 2021-07-13_Add_escapeJSON_to_legend_entries

2 years agoupdate to python 3
Tobias Oetiker [Wed, 14 Jul 2021 15:57:15 +0000 (17:57 +0200)] 
update to python 3

2 years agodo not try to autobuild
Tobias Oetiker [Wed, 14 Jul 2021 15:27:06 +0000 (17:27 +0200)] 
do not try to autobuild

2 years agofix build ionstructions
Tobias Oetiker [Wed, 14 Jul 2021 11:38:39 +0000 (13:38 +0200)] 
fix build ionstructions

2 years agoadd dependencies
Tobias Oetiker [Wed, 14 Jul 2021 11:37:11 +0000 (13:37 +0200)] 
add dependencies

2 years agoCreate codeql-analysis.yml
Tobias Oetiker [Wed, 14 Jul 2021 11:31:00 +0000 (13:31 +0200)] 
Create codeql-analysis.yml

2 years agoAdd escapeJSON() to legend entries
Wolfgang Stöggl [Tue, 13 Jul 2021 18:23:54 +0000 (20:23 +0200)] 
Add escapeJSON() to legend entries

Double quotes in legends are currently not escaped, if JSON imgformat
is used for rrdtool graph. This produces invalid JSON files.
See comment in #409 for further details.

2 years agoMerge pull request #1121 from c72578/2021-06-29_vcpkg_github_action
Tobias Oetiker [Mon, 5 Jul 2021 06:23:11 +0000 (08:23 +0200)] 
Merge pull request #1121 from c72578/2021-06-29_vcpkg_github_action

Update Windows GitHub Actions

2 years agomini change to trigger travis 1121/head
Tobias Oetiker [Sun, 4 Jul 2021 15:57:23 +0000 (17:57 +0200)] 
mini change to trigger travis

2 years agoUpdate Windows GitHub Actions
Wolfgang Stöggl [Tue, 29 Jun 2021 19:16:53 +0000 (21:16 +0200)] 
Update Windows GitHub Actions

- Update ci-workflow.yml and add GitHub Actions for Windows builds
  using MSVC and vcpkg. Both, x64 and x86 builds are part of the CI.
  The required vcpkg ports are installed and cached using
  lukka/run-vcpkg@v7
- Add release-windows.yml, which enables building Windows binaries of
  RRDtool. This GitHub action is run automatically upon new tags and
  can be triggered manually. The required .exe and .dll files are
  copied using collect_rrdtool_vcpkg_files.bat and deployed by
  actions/upload-artifact@v2
- Makefile_vcpkg.msc:
  Add include\harfbuzz, which is required for building pango.
Fixes: pango-coverage.h(28): fatal error C1083:
  Cannot open include file: 'hb.h': No such file or directory

2 years agoMerge pull request #1117 from yarda/python-rpath-drop
Tobias Oetiker [Fri, 28 May 2021 06:45:06 +0000 (08:45 +0200)] 
Merge pull request #1117 from yarda/python-rpath-drop

Fix RPATH for the python bindings

2 years agoFix RPATH for the python bindings 1117/head
Jaroslav Škarvada [Wed, 26 May 2021 19:05:43 +0000 (21:05 +0200)] 
Fix RPATH for the python bindings

Fixes #1116

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
3 years agoMerge pull request #1111 from svenpanne/fix-error-formatting
Tobias Oetiker [Mon, 22 Mar 2021 15:19:08 +0000 (16:19 +0100)] 
Merge pull request #1111 from svenpanne/fix-error-formatting

Avoid segfault: Don't read and write into the same buffer.

3 years agoAvoid segfault: Don't read and write into the same buffer. 1111/head
Sven Panne [Mon, 22 Mar 2021 11:55:26 +0000 (12:55 +0100)] 
Avoid segfault: Don't read and write into the same buffer.

Using CTX->rrd_error as a source *and* destination buffer at the same time
provokes undefined behavior.  In real life you get funny error messages
and/or segfaults within vs(n)printf().

Simple solution: Use a temporary copy of the error message while writing
into it.

3 years agoMerge pull request #1110 from c72578/2021-03-31_Switch_to_pkgconf_MSYS2
Tobias Oetiker [Tue, 16 Mar 2021 07:44:29 +0000 (08:44 +0100)] 
Merge pull request #1110 from c72578/2021-03-31_Switch_to_pkgconf_MSYS2

Switch to pkgconf (MSYS2, MinGW-w64)

3 years agoMerge branch 'master' into 2021-03-31_Switch_to_pkgconf_MSYS2 1110/head
Tobias Oetiker [Mon, 15 Mar 2021 08:30:34 +0000 (09:30 +0100)] 
Merge branch 'master' into 2021-03-31_Switch_to_pkgconf_MSYS2

3 years agoMerge pull request #1109 from c72578/2021-03-13_Update_Debian_link
Tobias Oetiker [Mon, 15 Mar 2021 08:30:14 +0000 (09:30 +0100)] 
Merge pull request #1109 from c72578/2021-03-13_Update_Debian_link

Update Debian link

3 years agoSwitch to pkgconf (MSYS2, MinGW-w64)
Wolfgang Stöggl [Sat, 13 Mar 2021 09:06:06 +0000 (10:06 +0100)] 
Switch to pkgconf (MSYS2, MinGW-w64)

The MSYS2 project has switched from pkg-config to pkgconf as default.
For details, see: https://github.com/msys2/MSYS2-packages/pull/2197
Both packages work when building RRDtool for Windows using MSYS2.
- Switch to pkgconf instead of pkg-config
- Update the following files:
  .github/workflows/ci-workflow.yml
  win32/README-MinGW-w64
- This avoids the following warning in the Windows CI-build:
  warning: removing 'mingw-w64-x86_64-pkg-config' from target list
  because it conflicts with 'mingw-w64-x86_64-pkgconf'

3 years agoUpdate Debian link 1109/head
Wolfgang Stöggl [Sat, 13 Mar 2021 07:03:25 +0000 (08:03 +0100)] 
Update Debian link

- Resolves #1104

3 years agoMerge pull request #1108 from mistotebe/issue1101
Tobias Oetiker [Fri, 12 Mar 2021 14:34:54 +0000 (15:34 +0100)] 
Merge pull request #1108 from mistotebe/issue1101

Plug some leaks in rrdcached

3 years agoIssue #1101 Free parsed->field_idx when done 1108/head
Ondřej Kuzník [Fri, 12 Mar 2021 13:27:55 +0000 (13:27 +0000)] 
Issue #1101 Free parsed->field_idx when done

3 years agoIssue #1101 Do not leak filename opening a broken file
Ondřej Kuzník [Fri, 12 Mar 2021 13:27:06 +0000 (13:27 +0000)] 
Issue #1101 Do not leak filename opening a broken file

3 years agoMerge pull request #1102 from kleinik/master
Tobias Oetiker [Mon, 11 Jan 2021 17:16:17 +0000 (18:16 +0100)] 
Merge pull request #1102 from kleinik/master

Reproducibility improvement

3 years agoUse BUILD_DATE for reproducibility 1102/head
Viktor Kleinik [Mon, 11 Jan 2021 14:29:00 +0000 (06:29 -0800)] 
Use BUILD_DATE for reproducibility

Use reproducible build date instead of compilation time and date.

Signed-off-by: Viktor Kleinik <vkleinik@cisco.com>
3 years agoconfigure.ac: Set build date to SOURCE_DATE_EPOCH
Viktor Kleinik [Mon, 11 Jan 2021 13:15:36 +0000 (05:15 -0800)] 
configure.ac: Set build date to SOURCE_DATE_EPOCH

If SOURCE_DATE_EPOCH is set, use it to generate a reproducible string for
BUILD_DATE.

Signed-off-by: Viktor Kleinik <vkleinik@cisco.com>
3 years agoMerge pull request #1099 from nirgal/patch-5
Tobias Oetiker [Wed, 30 Dec 2020 14:45:01 +0000 (15:45 +0100)] 
Merge pull request #1099 from nirgal/patch-5

Switch to python3

3 years agoSwitch to python3 1099/head
nirgal [Mon, 28 Dec 2020 15:37:03 +0000 (15:37 +0000)] 
Switch to python3

Python2 is dead

3 years agoUse a separate pango fontmap per thread
Simon Arlott [Fri, 11 Dec 2020 18:38:42 +0000 (18:38 +0000)] 
Use a separate pango fontmap per thread

Reusing the same fontmap from multiple threads is not safe, despite
the attempts to use a mutex to protect it there are other instances
where it behaves unexpectedly if graphs are created from multiple
threads at the same time, e.g.:

(process:76234): Pango-WARNING **: 11:47:25.823: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans Mono 8'
(process:76234): Pango-WARNING **: 11:47:25.823: font_face status is: no error has occurred
(process:76234): Pango-WARNING **: 11:47:25.823: scaled_font status is: invalid matrix (not invertible)
(process:76234): Pango-WARNING **: 11:47:25.823: shaping failure, expect ugly output. shape-engine='PangoFcShapeEngine', font='DejaVu Sans Mono 8', text='Apparent temp (?C)'

This error results in boxes instead of characters on the graph. In the
worst case scenario there are memory management errors that cause GLib
to complain or the process to abort.

Calling pango_cairo_font_map_get_default() multiple times from the same
thread will return the same object, so this satisfies the performance
expectations of reusing it within a single thread. Trying to lock a
mutex for even more pango/cairo function calls is likely to decrease
performance when multiple threads are used concurrently.

3 years agoMerge pull request #1087 from netniV/add-jsontime
Tobias Oetiker [Thu, 13 Aug 2020 07:45:27 +0000 (09:45 +0200)] 
Merge pull request #1087 from netniV/add-jsontime

Add JSONTIME output to graphv data

3 years agoMerge branch 'master' into add-jsontime 1087/head
Tobias Oetiker [Thu, 13 Aug 2020 07:14:34 +0000 (09:14 +0200)] 
Merge branch 'master' into add-jsontime

3 years agoMerge pull request #1091 from c72578/2020-08-08_Add_python_details_to_configure_summary
Tobias Oetiker [Tue, 11 Aug 2020 19:36:58 +0000 (21:36 +0200)] 
Merge pull request #1091 from c72578/2020-08-08_Add_python_details_to_configure_summary

Add python details to configure summary

3 years agoAdd python details to configure summary 1091/head
Wolfgang Stöggl [Tue, 11 Aug 2020 17:13:41 +0000 (19:13 +0200)] 
Add python details to configure summary

The output in the summary of configure will look like this:
 Build Python Bindings: yes
         Python Binary: /usr/bin/python
        Python Version: 3.8

3 years agoMerge branch 'master' into add-jsontime
Tobias Oetiker [Mon, 10 Aug 2020 07:05:45 +0000 (09:05 +0200)] 
Merge branch 'master' into add-jsontime

3 years agoMerge pull request #1090 from c72578/2020-08-09_Add_no-undefined_automatically_for_Mi...
Tobias Oetiker [Mon, 10 Aug 2020 07:04:03 +0000 (09:04 +0200)] 
Merge pull request #1090 from c72578/2020-08-09_Add_no-undefined_automatically_for_MinGW-w64_builds

Add -no-undefined automatically for MinGW-w64

3 years agoAdd -no-undefined automatically for MinGW-w64 1090/head
Wolfgang Stöggl [Sun, 9 Aug 2020 19:20:02 +0000 (21:20 +0200)] 
Add -no-undefined automatically for MinGW-w64

The linker flag -no-undefined is required, when building the dll for
Windows using MinGW-w64. Add -no-undefined to librrd_la_LDFLAGS in
Makefile.am in case of MinGW-w64 builds. This way it is not necessary
anymore to add LDFLAGS=-no-undefined to the make command.

3 years agoUse the correct name of file
netniV [Sat, 8 Aug 2020 08:18:43 +0000 (08:18 +0000)] 
Use the correct name of file

3 years agoFix typo
netniV [Sun, 2 Aug 2020 22:09:47 +0000 (22:09 +0000)] 
Fix typo

3 years agoAdd unit test for --add-jsontime
netniV [Sat, 1 Aug 2020 19:18:16 +0000 (19:18 +0000)] 
Add unit test for --add-jsontime

3 years agoMerge branch 'master' into add-jsontime
Mark Brugnoli-Vinten [Mon, 27 Jul 2020 16:54:29 +0000 (17:54 +0100)] 
Merge branch 'master' into add-jsontime

3 years agoMerge pull request #1089 from c72578/2020-07-24_Add_Windows_MSYS2_GitHub_Action
Tobias Oetiker [Sun, 26 Jul 2020 11:11:53 +0000 (13:11 +0200)] 
Merge pull request #1089 from c72578/2020-07-24_Add_Windows_MSYS2_GitHub_Action

Add Windows MSYS2 GitHub Action

3 years agoAdd Windows MSYS2 GitHub Action 1089/head
Wolfgang Stöggl [Fri, 24 Jul 2020 19:05:07 +0000 (21:05 +0200)] 
Add Windows MSYS2 GitHub Action

This enables CI for Windows builds using MSYS2 mingw-w64-x86_64.
The GitHub Action is based on: https://www.msys2.org/docs/ci/

3 years agoMerge pull request #1088 from jyavenard/utc
Tobias Oetiker [Wed, 22 Jul 2020 12:47:15 +0000 (14:47 +0200)] 
Merge pull request #1088 from jyavenard/utc

Add --utc to graph option.

3 years agoAdd --utc to graph option. 1088/head
Jean-Yves Avenard [Thu, 17 Jan 2013 18:20:36 +0000 (05:20 +1100)] 
Add --utc to graph option.

Allow to generate a graph as if the current timezone was UTC (e.g set TZ=UTC).
This allows to easily calculate daily average ranging from midgnight to midnight rather than say the last 24 hours.

3 years agoAdd documentation for --add-jsontime command
netniV [Sun, 5 Jul 2020 23:34:35 +0000 (23:34 +0000)] 
Add documentation for --add-jsontime command

3 years agoAdd --add-jsontime parameter to help listing
netniV [Sun, 5 Jul 2020 23:22:49 +0000 (23:22 +0000)] 
Add --add-jsontime parameter to help listing

3 years agoFix --add-jsontime error message
netniV [Sun, 5 Jul 2020 12:02:01 +0000 (12:02 +0000)] 
Fix --add-jsontime error message

3 years agoAllow JSONTIME to be added to graphv output
netniV [Sun, 5 Jul 2020 11:59:21 +0000 (11:59 +0000)] 
Allow JSONTIME to be added to graphv output

3 years agoMerge pull request #1074 from commx/fetch-freefix
Tobias Oetiker [Fri, 3 Jul 2020 14:15:47 +0000 (16:15 +0200)] 
Merge pull request #1074 from commx/fetch-freefix

fetch - do not call rrd_freemem on uninitialized pointers

3 years agoMerge branch 'master' into fetch-freefix 1074/head
Tobias Oetiker [Fri, 3 Jul 2020 06:19:42 +0000 (08:19 +0200)] 
Merge branch 'master' into fetch-freefix

3 years agoMerge pull request #1086 from jer-gentoo/rrdtool-distribute-doc-rrdrados
Tobias Oetiker [Fri, 3 Jul 2020 06:19:23 +0000 (08:19 +0200)] 
Merge pull request #1086 from jer-gentoo/rrdtool-distribute-doc-rrdrados

doc: Distribute rrdrados.pod

3 years agodoc: Distribute rrdrados.pod 1086/head
Jeroen Roovers [Wed, 1 Jul 2020 16:35:29 +0000 (18:35 +0200)] 
doc: Distribute rrdrados.pod

3 years agoMerge pull request #1085 from zeising/zeising/zfs-fallocate
Tobias Oetiker [Sun, 14 Jun 2020 13:44:08 +0000 (15:44 +0200)] 
Merge pull request #1085 from zeising/zeising/zfs-fallocate

rrd_open: Ignore EINVAL from posix_fallocate()

3 years agorrd_open: Ignore EINVAL from posix_fallocate() 1085/head
Niclas Zeising [Sun, 14 Jun 2020 09:31:33 +0000 (11:31 +0200)] 
rrd_open: Ignore EINVAL from posix_fallocate()

ZFS on FreeBSD (at least) does not support posix_fallocate(),
returning EINVAL instead.  Ignore this error and continue normally.
Without this change, it is not possible to resize rrd files on ZFS.

This fixes #1082

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
4 years agoMerge branch 'master' into fetch-freefix
Tobias Oetiker [Sat, 14 Mar 2020 16:45:04 +0000 (17:45 +0100)] 
Merge branch 'master' into fetch-freefix

4 years agoMerge pull request #1079 from neirbowj/gh1078_xrule
Tobias Oetiker [Sat, 14 Mar 2020 16:44:45 +0000 (17:44 +0100)] 
Merge pull request #1079 from neirbowj/gh1078_xrule

Fix double meaning of time 0 as uninitialized value

4 years agoFix double meaning of time 0 as uninitialized value 1079/head
John W. O'Brien [Sat, 14 Mar 2020 12:49:47 +0000 (08:49 -0400)] 
Fix double meaning of time 0 as uninitialized value

Treat "VRULE:0#..." as "VRULE:1#..." because elsewhere xrule==0 is
used to mean xrule has not been set, which can lead to an array
bounds violation.

4 years agofreemem only for valid status
Christian Kröger [Thu, 6 Feb 2020 23:43:18 +0000 (00:43 +0100)] 
freemem only for valid status

4 years agoMerge pull request #1072 from SuperHeron/acinclude-python3
Tobias Oetiker [Fri, 3 Jan 2020 08:40:39 +0000 (09:40 +0100)] 
Merge pull request #1072 from SuperHeron/acinclude-python3

Fix AM_CHECK_PYTHON_HEADERS macro for Python3

4 years agoFix AM_CHECK_PYTHON_HEADERS macro for Python3 1072/head
Pierre Lejeune [Mon, 30 Dec 2019 00:30:58 +0000 (01:30 +0100)] 
Fix AM_CHECK_PYTHON_HEADERS macro for Python3

This detects Python3 include paths like /usr/include/python3.7m.
Taken from pygobject.

4 years agoMerge pull request #1069 from Thomas-Gelf/patch-2
Tobias Oetiker [Tue, 10 Dec 2019 15:14:25 +0000 (16:14 +0100)] 
Merge pull request #1069 from Thomas-Gelf/patch-2

rrdgraph_rpn.pod: fix typo

4 years agorrdgraph_rpn.pod: fix typo 1069/head
Thomas Gelf [Fri, 29 Nov 2019 17:52:41 +0000 (18:52 +0100)] 
rrdgraph_rpn.pod: fix typo

This should probably have read `Now` (instead of `No`). I dropped the whole word as the former sentence also starts with `Now`.

4 years agorrdgraph_rpn.pod: fix SMIN example
Thomas Gelf [Fri, 29 Nov 2019 15:44:57 +0000 (16:44 +0100)] 
rrdgraph_rpn.pod: fix SMIN example

4 years agoUse LC_NUMERIC=C for tests
Wolfgang Stöggl [Mon, 18 Nov 2019 19:11:47 +0000 (20:11 +0100)] 
Use LC_NUMERIC=C for tests

The following tests require dot as decimal separator:
graph1, rpn1, create-with-source-4, dcounter1, vformatter1, pdp-calc1

Set LC_NUMERIC=C, which allows these tests to pass also under locales,
where the decimal separator is not a dot by default:
de_DE, es_ES, fr_FR, nl_NL etc.

4 years agoAdd podchecker to .travis.yml
Wolfgang Stöggl [Tue, 12 Nov 2019 11:58:28 +0000 (12:58 +0100)] 
Add podchecker to .travis.yml

- Check the syntax of doc/*.pod files

4 years agoUpdate rrdlist manual
Jean-Michel Vourgère [Tue, 12 Nov 2019 10:29:48 +0000 (11:29 +0100)] 
Update rrdlist manual

Add documentation for --noflush and --recursive options.

4 years agoFix rrd_pdpcalc whatis entry in manual
Jean-Michel Vourgère [Tue, 12 Nov 2019 10:49:39 +0000 (11:49 +0100)] 
Fix rrd_pdpcalc whatis entry in manual

From Debian lintian checker:
 Each manual page should start with a "NAME" section, which lists the
 name and a brief description of the page separated by "\-". The "NAME"
 section is parsed by lexgrog and used to generate a database that's
 queried by commands like apropos and whatis. This tag indicates that
 lexgrog was unable to parse the NAME section of this manual page.

 For manual pages that document multiple programs, functions, files, or
 other things, the part before "\-" should list each separated by a comma
 and a space. Each thing listed must not contain spaces; a man page for a
 two-part command like "fs listacl" must use something like "fs_listacl"
 in the "NAME" section so that it can be parsed by lexgrog.

 Refer to the lexgrog(1) manual page, the groff_man(7) manual page, and
 the groff_mdoc(7) manual page for details.

4 years agoUpdate .travis.yml according to yamllint
Wolfgang Stöggl [Wed, 9 Oct 2019 10:56:48 +0000 (12:56 +0200)] 
Update .travis.yml according to yamllint

- Fix the following warnings and errors reported by yamllint 1.17.0:

24:1  warning  comment not indented like content (comments-indentation)
28:1  warning  comment not indented like content (comments-indentation)
44:18 error    trailing spaces (trailing-spaces)
49:1  error    too many blank lines (1 > 0) (empty-lines)

- Used the following yamllint command:
  yamllint -d "{extends: default, rules: {document-start: disable, \
  line-length: {max: 512}}}" .travis.yml

4 years agoFix potential duplicate write_changes_to_disk() calls 2019-10
Yong Li [Mon, 30 Sep 2019 12:16:43 +0000 (08:16 -0400)] 
Fix potential duplicate write_changes_to_disk() calls

Fix duplicate write_changes_to_disk() calls when HAVE_LIBRADOS is true and HAVE_MMAP is false

4 years agoSort and remove duplicate entries in ALL_LIBS
Wolfgang Stöggl [Thu, 26 Sep 2019 07:27:47 +0000 (09:27 +0200)] 
Sort and remove duplicate entries in ALL_LIBS

- So far, configure showed e.g. the following at the end:
Libraries: -lgobject-2.0 -lpng -lm  -ldbi -lglib-2.0  -lpangocairo-1.0
 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lcairo  -lxml2

The variable ALL_LIBS included duplicates resulting from the configure
process and some double spaces.

- Now, ALL_LIBS is sorted and duplicate entries are removed, e.g.:
Libraries: -lcairo -ldbi -lglib-2.0 -lgobject-2.0 -lharfbuzz -lm
 -lpango-1.0 -lpangocairo-1.0 -lpng -lxml2

4 years agoSync librrd-8.def with librrd.sym
Wolfgang Stöggl [Tue, 10 Sep 2019 14:32:58 +0000 (16:32 +0200)] 
Sync librrd-8.def with librrd.sym

- Export the same functions in the dll from MSVC builds under Windows
  as defined in librrd.sym

4 years agolibrrd.sym: add missing rrdc symbols
Derrick Lyndon Pallas [Thu, 29 Aug 2019 20:44:12 +0000 (20:44 +0000)] 
librrd.sym: add missing rrdc symbols

4 years agoRemove duplicate code of find_first_weekday()
Wolfgang Stöggl [Sun, 8 Sep 2019 13:19:09 +0000 (15:19 +0200)] 
Remove duplicate code of find_first_weekday()

So far, the same code of find_first_weekday() was used in rrd_graph.c
and rrd_rpncalc.c
Remove duplicate code from rrd_graph.c and add find_first_weekday()
to rrd_rpncalc.h, which is included from rrd_graph.h

4 years agoIndent rrd_rpncalc.h
Wolfgang Stöggl [Sun, 8 Sep 2019 13:12:54 +0000 (15:12 +0200)] 
Indent rrd_rpncalc.h

- indent src/rrd_rpncalc.h using GNU indent 2.2.12
  before further changes to the code

4 years agoUse DefaultPlatformToolset for .vcxproj files
Wolfgang Stöggl [Tue, 10 Sep 2019 10:07:14 +0000 (12:07 +0200)] 
Use DefaultPlatformToolset for .vcxproj files

- Use $(DefaultPlatformToolset) for the PlatformToolset
  instead of v140. This allows to use the associated PlatformToolset
  automatically for each version of Visual Studio:
  v140 for VS2015, v141 for VS2017, v142 for VS2019.
  However, a developer can easily target projects to a desired,
  different PlatformToolset.
- Set ToolsVersion="Current" instead of ToolsVersion="14.0"
- Strings were replaced in .vcxproj files the following way:
  git grep -l 'v140' -- '*.vcxproj' | \
    xargs sed -i 's/v140/$(DefaultPlatformToolset)/g'
  git grep -l '14.0' -- '*.vcxproj' | xargs sed -i 's/14.0/Current/g'

4 years agoUse temp pointer for realloc()
Wolfgang Stöggl [Sat, 7 Sep 2019 20:27:22 +0000 (22:27 +0200)] 
Use temp pointer for realloc()

- Fixes the following Cppcheck 1.89 errors:
  [src/rrd_cgi.c:295] (error) Common realloc mistake:'varheap'
    nulled but not freed upon failure [memleakOnRealloc]
  [src/rrd_cgi.c:1138] (error) Common realloc mistake: 'argv'
    nulled but not freed upon failure [memleakOnRealloc]
  [src/rrd_graph.c:1211] (error) Common realloc mistake: 'steparray'
    nulled but not freed upon failure [memleakOnRealloc]

4 years agorrd_client: avoid invalid read
Derrick Lyndon Pallas [Tue, 3 Sep 2019 20:39:33 +0000 (20:39 +0000)] 
rrd_client: avoid invalid read

In rrd_client_last and rrd_client_first, the response value is in the
message prior to any additional lines.  Unfortunately, the buffer that
contains this data is on the stack for response_read and is no longer valid
by the time the caller sees it.

This change strdups the message line in response_read and subsequently frees
it in response_free.

Resolves issue #1047.

4 years agoClean tests/rpn1.out
Wolfgang Stöggl [Mon, 2 Sep 2019 10:20:54 +0000 (12:20 +0200)] 
Clean tests/rpn1.out

- There was another leftover in the tests folder after
  make clean: rpn1.out
  It is a png file created during the test rpn1
- This is a followup commit to PR #1049

4 years agoClean up tests leftover files
nirgal [Sun, 1 Sep 2019 15:26:51 +0000 (15:26 +0000)] 
Clean up tests leftover files

4 years agoZero wbuf on start.
Clar Fon [Sun, 25 Aug 2019 23:18:47 +0000 (19:18 -0400)] 
Zero wbuf on start.

It turns out that calloc isn't enough, because listen_fds is copied to the socket array on start. This zeroes these fields out when the socket is opened.

4 years agoAllocate client_sock using calloc instead of malloc
Clar Fon [Thu, 22 Aug 2019 21:48:42 +0000 (17:48 -0400)] 
Allocate client_sock using calloc instead of malloc

This ensures that wbuf_data, wbuf_size, and wbuf_capacity are all initialised to zero

4 years agoFix compiler warning (-Wstringop-truncation)
Wolfgang Stöggl [Thu, 22 Aug 2019 12:18:35 +0000 (14:18 +0200)] 
Fix compiler warning (-Wstringop-truncation)

- Use strncat() the following way in rrd_cgi.c:
  strncat(dest, src, dest_size - strlen(dest) - 1);

- Fixes the following gcc compiler warning:
  rrd_cgi.c:1407:21: warning: ‘strncat’ output truncated before
  terminating nul copying as many bytes from a string as its length
  [-Wstringop-truncation]
  strncat(line, tmp, tmplen);

4 years agoFix compiler warnings (-Wcast-function-type)
Wolfgang Stöggl [Wed, 21 Aug 2019 15:50:09 +0000 (17:50 +0200)] 
Fix compiler warnings (-Wcast-function-type)

- Add tree_compare_func() and use this function instead of
  `(GCompareDataFunc) strcmp`
  Fixes the following gcc compiler warning:
  rrd_daemon.c:4245:34: warning: cast between incompatible function
  types from ‘int (*)(const char *, const char *)’
  to ‘gint (*)(const void *, const void *, void *)’
  {aka ‘int (*)(const void *, const void *, void *)’}
  [-Wcast-function-type]
  cache_tree = g_tree_new_full((GCompareDataFunc) strcmp, NULL, NULL,

- Use g_strcmp0() instead of strcmp() in tree_compare_func().
  g_strcmp0() compares str1 and str2 like strcmp(). Handles NULL
  gracefully by sorting it before non-NULL strings.
  Comparing two NULL pointers returns 0.

- Cast free_cache_item using (void (*)(void)
  Fixes the following gcc compiler warning:
  rrd_daemon.c:4246:34: warning: cast between incompatible function
  types from ‘void * (*)(cache_item_t *)’
  {aka ‘void * (*)(struct cache_item_s *)’}
  to ‘void (*)(void *)’ [-Wcast-function-type]
  (GDestroyNotify) free_cache_item);

4 years agoFix typos found by codespell
Wolfgang Stöggl [Wed, 14 Aug 2019 09:44:25 +0000 (11:44 +0200)] 
Fix typos found by codespell

- Typos were found by codespell v1.15.0

4 years agoUpdate .travis.yml for Ubuntu xenial (16.04LTS)
Wolfgang Stöggl [Fri, 2 Aug 2019 17:00:10 +0000 (19:00 +0200)] 
Update .travis.yml for Ubuntu xenial (16.04LTS)

- Install libtool-bin to fix failing "valgrind-logfile" tests
- Enable the following "valgrind-logfile" tests, which are passing now
  under xenial: create-with-source-4, vformatter1
  Add also graph1 and pdp-calc1, which have been added in the meantime.
  There are only three failing tests left: rpn1, rpn2, xport1
- Add Perl 5.22, which is the version in xenial

4 years agoUpdate win32-glob.c to current upstream version
Wolfgang Stöggl [Tue, 30 Jul 2019 09:31:33 +0000 (11:31 +0200)] 
Update win32-glob.c to current upstream version

See commit https://sourceforge.net/p/sox/code/ci/5761ed/
for upstream fix.

4 years agoCleanup ssize_t, off_t and strtoll() for MSVC
Wolfgang Stöggl [Sat, 20 Jul 2019 11:20:12 +0000 (13:20 +0200)] 
Cleanup ssize_t, off_t and strtoll() for MSVC

MSVC defines the standard type off_t. Remove unneeded off_t typedef.

So far there has been a "typedef size_t ssize_t" in case of _MSC_VER,
which is incorrect because size_t is unsigned and ssize_t signed.
MSVC supports SSIZE_T (in capital letters). It is sufficient to have
the typedef SSIZE_T ssize_t in rrd.h - remove redundant, obsolete code
from rrd_restore.c

The function strtoll() is supported since Visual Studio 2013.

In rrd_resize.c, b_read is ssize_t. Use %zd in fprintf() as format
specifier, because ssize_t is signed.

4 years agoIndent rrd.h
Wolfgang Stöggl [Sat, 20 Jul 2019 10:58:28 +0000 (12:58 +0200)] 
Indent rrd.h

- indent src/rrd.h using GNU indent 2.2.12
  before further changes to the code

4 years agoFix rrd_cgi.c Cppcheck_warnings
Wolfgang Stöggl [Wed, 17 Jul 2019 10:36:30 +0000 (12:36 +0200)] 
Fix rrd_cgi.c Cppcheck_warnings

Remove the identical inner 'if' condition.
Use the %zu format specifier for size_t returned from strlen(),
according to: https://en.cppreference.com/w/c/string/byte/strlen

- Fixes the following Cppcheck warnings:
  [src/rrd_cgi.c:349] (warning) Identical inner 'if' condition is
    always true (outer condition is 'calcpr[i]' and inner condition is
    'calcpr[i]'). [identicalInnerCondition]

  [src/rrd_cgi.c:527] (portability) %zd in format string (no. 1)
    requires 'ssize_t' but the argument type is 'size_t
    {aka unsigned long}'. [invalidPrintfArgType_sint]
  or
  [src/rrd_cgi.c:527] (portability) %zd in format string (no. 1)
    requires 'ssize_t' but the argument type is 'size_t
    {aka unsigned long long}'. [invalidPrintfArgType_sint]

4 years agoIndent rrd_cgi.c
Wolfgang Stöggl [Wed, 17 Jul 2019 10:30:15 +0000 (12:30 +0200)] 
Indent rrd_cgi.c

- indent src/rrd_cgi.c using GNU indent 2.2.12
  before further changes to the code

4 years agoFix format specifiers
Wolfgang Stöggl [Mon, 15 Jul 2019 13:09:06 +0000 (15:09 +0200)] 
Fix format specifiers

- Fixes the following Cppcheck warnings:

  [bindings/tcl/tclrrd.c:513] (warning) %lu in format string (no. 1)
    requires 'unsigned long' but the argument type is 'signed long'.
    [invalidPrintfArgType_uint]

  [src/rrd_fetch_libdbi.c:56] (warning) %i in format string (no. 3)
    requires 'int' but the argument type is 'unsigned int'.
    [invalidPrintfArgType_sint]
  [src/rrd_fetch_libdbi.c:63] (warning) %i in format string (no. 3)
    requires 'int' but the argument type is 'unsigned int'.
    [invalidPrintfArgType_sint]
  [src/rrd_fetch_libdbi.c:85] (warning) %i in format string (no. 3)
    requires 'int' but the argument type is 'unsigned int'.
    [invalidPrintfArgType_sint]
  [src/rrd_fetch_libdbi.c:85] (warning) %i in format string (no. 4)
    requires 'int' but the argument type is 'unsigned int'.
    [invalidPrintfArgType_sint]
  [src/rrd_fetch_libdbi.c:119] (warning) %i in format string (no. 3)
    requires 'int' but the argument type is 'unsigned int'.
    [invalidPrintfArgType_sint]
  [src/rrd_fetch_libdbi.c:126] (warning) %i in format string (no. 3)
    requires 'int' but the argument type is 'unsigned int'.
    [invalidPrintfArgType_sint]
  [src/rrd_fetch_libdbi.c:148] (warning) %i in format string (no. 3)
    requires 'int' but the argument type is 'unsigned int'.
    [invalidPrintfArgType_sint]
  [src/rrd_fetch_libdbi.c:148] (warning) %i in format string (no. 4)
    requires 'int' but the argument type is 'unsigned int'.
    [invalidPrintfArgType_sint]

  [src/rrd_graph_helper.c:1504] (warning) %u in format string (no. 2)
    requires 'unsigned int' but the argument type is 'signed int'.
    [invalidPrintfArgType_uint]
  [src/rrd_graph_helper.c:1511] (warning) %u in format string (no. 2)
    requires 'unsigned int' but the argument type is 'signed int'.
    [invalidPrintfArgType_uint]
  [src/rrd_graph_helper.c:1695] (warning) %u in format string (no. 1)
    requires 'unsigned int' but the argument type is 'signed int'.
    [invalidPrintfArgType_uint]
  [src/rrd_graph_helper.c:1812] (warning) %u in format string (no. 2)
    requires 'unsigned int' but the argument type is 'signed int'.
    [invalidPrintfArgType_uint]

  [src/rrd_tune.c:392] (warning) %ld in format string (no. 3)
    requires 'long' but the argument type is 'unsigned long'.
    [invalidPrintfArgType_sint]

4 years agoAdd check for va_copy to configure
Wolfgang Stöggl [Fri, 12 Jul 2019 13:56:37 +0000 (15:56 +0200)] 
Add check for va_copy to configure

So far, configure did not check for va_copy and HAVE_VA_COPY was
undefined. A check for HAVE_VA_COPY is part of rrd_snprintf.c

- Add HW_FUNC_VA_COPY to configure.ac
- MSVC has got va_copy(), so define it in win32/rrd_config.h:
  #define HAVE_VA_COPY 1

4 years agoUse temp pointer for realloc()
Wolfgang Stöggl [Thu, 11 Jul 2019 13:00:09 +0000 (15:00 +0200)] 
Use temp pointer for realloc()

If realloc() fails, it returns NULL and the original block is
left untouched; it is not freed. Use a temporary pointer first to
check, if realloc() has failed.

- Fixes the following Cppcheck errors:
  [src/rrd_create.c:958] (error) Common realloc mistake: 'mappings'
    nulled but not freed upon failure [memleakOnRealloc]
  [src/rrd_create.c:2451] (error) Common realloc mistake: 'candidates'
    nulled but not freed upon failure [memleakOnRealloc]
  [src/rrd_daemon.c:2402] (error) Common realloc mistake: 'sources'
    nulled but not freed upon failure [memleakOnRealloc]

4 years agoAdd Bear compilation database file to .gitignore
Wolfgang Stöggl [Thu, 11 Jul 2019 09:46:15 +0000 (11:46 +0200)] 
Add Bear compilation database file to .gitignore

- Add compile_commands.json to .gitignore. This compilation database
  file can be created by Build EAR
  (BEAR, https://github.com/rizsotto/Bear) and used by Cppcheck

4 years agoIndent rrd_daemon.c
Wolfgang Stöggl [Thu, 11 Jul 2019 09:32:10 +0000 (11:32 +0200)] 
Indent rrd_daemon.c

- indent src/rrd_daemon.c using GNU indent 2.2.12
  before further changes to the code

4 years agoUpdate MSVC .vcxproj files (SAFESH, IntDir)
Wolfgang Stöggl [Tue, 9 Jul 2019 09:24:42 +0000 (11:24 +0200)] 
Update MSVC .vcxproj files (SAFESH, IntDir)

Win32 Debug configurations have EditAndContinue set, whereas /SAFESEH
is incompatible with EditAndContinue. Add
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
to these configurations.

- Fixes the following warning in Visual Studio build log files, e.g.:
  warning LNK4075: ignoring '/EDITANDCONTINUE' due to
  '/SAFESEH' specification

The projects librrd-8, rrdcgi, rrdtool and rrdupdate are built in
the same directory, which is OK, as there is no overlap. No need for a
separate IntDir for each project. To silence the warning, add:
<IntDirSharingDetected>None</IntDirSharingDetected>

- Fixes the following warning in Visual Studio build log files, e.g.:
  warning MSB8028: The intermediate directory (Debug\) contains files
  shared from another project (librrd-8.vcxproj).
  This can lead to incorrect clean and rebuild behavior.

4 years agoFix identical inner if condition rrd_graph_helper
Wolfgang Stöggl [Mon, 8 Jul 2019 12:06:28 +0000 (14:06 +0200)] 
Fix identical inner if condition rrd_graph_helper

- Fixes the following Cppcheck warning:
  [src/rrd_graph_helper.c:972] (warning) Identical inner 'if' condition
  is always true
  (outer condition is '!vname' and inner condition is '!vname').
  [identicalInnerCondition]

4 years agoIndent rrd_graph_helper.c
Wolfgang Stöggl [Mon, 8 Jul 2019 10:50:49 +0000 (12:50 +0200)] 
Indent rrd_graph_helper.c

- indent src/rrd_graph_helper.c using GNU indent 2.2.12

4 years agoFix possible memory leak by buffer.file
Wolfgang Stöggl [Sat, 6 Jul 2019 12:14:28 +0000 (14:14 +0200)] 
Fix possible memory leak by buffer.file

Close the opened buffer.file in rrd_xport.c before return -1,
if the data processing has failed

- Fixes the following Cppcheck error:
  [rrdtool-1.x/src/rrd_xport.c:435] (error) Memory leak:
  buffer.file [memleak]

4 years agoInclude asprintf.h in rrd_info.c for MSVC builds
Wolfgang Stöggl [Sat, 6 Jul 2019 03:45:20 +0000 (05:45 +0200)] 
Include asprintf.h in rrd_info.c for MSVC builds

- Fixes the following MSVC level 3 compiler warning:
  rrd_info.c(21): warning C4013: 'vasprintf' undefined;
  assuming extern returning int
- This is a follow-up to PR #828 and commit b1bcbca

4 years agoAdd rrdcgi.vcxproj and update Makefile.am (MSVC)
Wolfgang Stöggl [Thu, 27 Jun 2019 19:35:40 +0000 (21:35 +0200)] 
Add rrdcgi.vcxproj and update Makefile.am (MSVC)

So far, rrdcgi.exe has been built using nmake. Add rrdcgi.vcxproj
as an additional Visual Studio project and add it to rrd.sln

- Update Makefile.am:
  Add win32/rrdcgi.vcxproj and win32/Makefile_vcpkg.msc to EXTRA_DIST
  Remove win32/rrdtool.sln and win32/rrdupdate.sln, because all
  projects are part of rrd.sln
- git rm win32/rrdtool.sln win32/rrdupdate.sln