mail.c: replace deprecated g_mutex_new() with g_mutex_init() and
fix const discarded warnings.
plugins.c: gkrellm_place_plugin() change code that inserts plugins into
monitor_list to avoid compiler warnings.
Patch from Ville Skytta: fix issues flagged by cppcheck:
- netbsd.c: add some close(fd) calls before returns in gkrellm_sys_battery_init().
- winops-win32.c: add a free() in gkrellm_winop_place_gkrellm().
Bugfixes:
- chart.c: flag config modified when changing a chart's Resolution per Grid.
- fix memory leaks in multiple files: add g_thread_unref() for all GThread
pointers returned from g_thread_new() calls.
Parsing an IPv6 prefix length has to reset errno prior to calling
strtoul() to reliably detect errors (the return value is not suitable
for detecting errors).
Patch taken straight from Debian BTS #764023. Thanks for Peter Denison
for spotting this and providing a patch.
Always enable ASLR and DEP when building GKrellM on Windows. Since
GKrellM also does network communication bugs like buffer overflows and
the like may eventually allow remote code execution. By enabling these
build flags such attacks should be quite a bit more complicated
(although still not impossible).
- Make the server configure script log the environment just like the
configure script used for the client.
- Honour the CFLAGS env var too since the other configure does the same
Do not try to execute generated executables. Altough this is a nice
idea in theory it breaks on cross compile environments which usually
cannot execute binaries of the target platform.
Remove Gtk+2 compile and link flags from all configure tests because:
- no test code depends on Gtk+2
- gkrellmd does not need Gtk+2 at all
- the cflags variable in the src/configure was misspelled and thus did
not have any effect
Move all make variables and rules duplicated between gkrellm and
gkrellmd makefiles into a common file that can be included. This
avoids duplication and hopefully avoids the two makefiles getting out
of sync too much. This is also a preparation to ease overriding
toolchain binaries (compiler, linker, pkgconfig) as part of windows
cross compiling.
This change also puts the "ar" tool into a variable that can be
overridden if needed.
Please note that this change uses the GNU Make specific include
statement but AFAICS the makefiles already depend on GNU extensions in
other areas (":=" and "ifdef" are non-standard make syntax).
GLib version 1 is very outdated by now and not available in any recent
Linux distribution. Keeping this code around without actually being
able to test it makes little sense so let's get rid of that.
- Always check the return value of
g_win32_get_package_installation_directory_of_module, this call may
fail and return NULL
- g_build_filename is documented as never returning NULL, no need to
check for that
- Use g_thread_new instead of g_thread create
- Drop explicit call of g_thread_init, it is done implicitely by GLib
since 2.32
- Since this bumps the minimum required GLib version add and extend the
pkg-config based version checks to error out on older GLib versions
Do not use the default LINK_FLAGS value for windows builds, the default
"-E" linker option only causes warnings for MinGW since it's essentially
ignored by the linker.
The flag is also unneeded since linking plugins against the gkrellm
binary is not done on win32 so none of the gkrellm/gkrellmd functions
need to be exported, the API is manually exposed via the win32-specific
libgkrellm/libgkrellmd static libs.
Honor the BINEXT variable in the gkrellm and gkrellmd target to enforce
building with the correct extension. This is needed for recent mingw-w64
cross toolchains since those do not automatically append ".exe" when
linking.
Explicitely add needed include arguments as well as linker arguments
for gmodule. Before this change we relied on gmodule being an implicit
dependency pulled in via the gtk+-2.0 module, this does not seem to be
the case anymore with >=gdk-pixbuf-2.24 and >=pango-1.30.
Thanks for Alexandre Rostovtsev for bringing this up on the mailinglist
and for providing a first patch.
See also https://bugs.gentoo.org/show_bug.cgi?id=428532
Mark mount points of type cifs as remote filesystems to make gkrellm use
nfs-timeout as polling interval instead of the standard fs-timeout which
should only be used to poll local filesystems.
Thanks to Gerard Neil for submitting this patch.
monitor.c: serve_disk_data() now uses a dynamic buffer for to-be-sent disk-lines instead of relying on a very short static array.
client.c: read_server_setup() now uses a static read buffer that is as big/small as the global server_buf. client_disk_line_from_server() now uses a dynamic string for disk names.
- src/disk.c, server/monitor.c: Add gkrellm_disk_add_by_name() that allows creating disks with a custom label from sysdep code.
- src/Makefile, server/Makefile: Cleanup of darwin/darwin9/macosx targets. All custom variables are now set in src/Makefile and server/Makefile to allow easy building inside these subdirs. Removed very old link-flags which were used before OS X 10.3.
- All Makefiles: Remove unused GTK_CONFIG definitions, they were neither passed as an argument nor executed anywhere.
- Makefile: Update comments documenting Darwin and OS X targets (darwin, darwin9 and macosx)
- src/sysdeps/darwin.c: Use utmpx instead of deprecated utmp.
- src/sysdeps/darwin.c: Fix possible leak in gkrellm_sys_cpu_init(), pinfo was never free'd.
- src/sysdeps/darwin.c: Rewrite disk device enumeration and performance gathering. The previous implementation failed as soon as a single device contained no medium, resulting in no/wrong performance data for all subsequent devices. Also provides labels for krells based on real device-names (uses new gkrellm_disk_add_by_name()).
Makefile, win32.c: Load ntdll.dll and lookup used functions at runtime (safer for future windows version and fixes unintended linking against sscanf() from ntdll)
win32.c: Add gkrellm_sys_inet_cleanup() for proper unloading of iphlpapi.dll
Remove parsing of "--debug-level" in get_args(), it is already parsed in parse_config()
Make "-d" commandline option the short version for "--detach" only. Before it was also used as a short version for "--debug-level"
- Revert gkrellm version header change, there are too many places in code/docs containing the version number, one more or less will not hurt
- configure: Make configure shell script write configure.mk and move logic for compiler and linker flags into configure
- configure: Also search openssl and libntlm via pkg-config and fall back to hardcoded library names for linking if not found
- Makefile: Workaround environment-bugs in win32 toolchain by switching from "override CC" to a normal makefile rule for building .o from .c files