Use gdk_pixbuf_new_from_data() instead of deprecated
gdk_pixbuf_new_from_inline(). Inline alert_inline[] needed to be --raw.
When gkrellmd refused connections, the socket was not flushed and the error
message might not be sent back to the client. Also, add a dialog to display
the error message.
When HAVE_SSL is false, previously, md5c.o was only compiled when
EXTRAOBJS was unset. But this is never the case since the top level
Makefile exports EXTRAOBJS. Now, append md5c.o to EXTRAOBJS instead.
Bug: https://bugs.gentoo.org/show_bug.cgi?id=560234#c10
Expect the C runtime on Linux to always have getaddrinfo(), glibc 2.1
was released in 1999 so by now every Linux environment should have this
function. This enables use of getaddrinfo() on C libraries other than
glibc, i.e. on musl libc.
This is an alternative approach to the patch posted to the gkrellm
mailinglist by Felix Janda which unfortunately had some drawbacks on
other platforms that need additional includes or libs when using
getaddrinfo(), most notably Solaris and Windows.
Only evaluate these shell commands once at Makefile startup, otherwise
every single call to the compiler/linker will re-evaluate these lines
again and again. This speeds up the build quite a bit for me.
- Handle Windows 6.1 - 6.3 which equals Windows 7, 8 and 8.1 including
its server variants
- Shorten the client/server differentiation by using a variable
The calling GKrellM code always expects a system name that can be split
at the first space character to provide kernel name and kernel version.
Return a string containing a space to avoid a crash on any Windows
version the code does not know about (or in case querying the version
failed).
Recent Gtk+ versions seem to defer creation of native windows even
further which made setting HWND_TOPMOST a no-op. Replace this lowlevel
hack with the standard Gtk+ way of making a window always-on-top, it
now works as expected.
A patch from Joe Garcia. A ssh tunnel can be up but possibly not
connected to anything in which case gkrellm_getline() can return 0.
This patch prevents a busy loop by limiting the 0 return retries.
Edit one of the CPU chart text format string options.
Fix gkrellm_category_vbox() so the returned vbox will be expanded like
it should be. This exposed a clock config box packing needing a change.
The Disk Launch Commands vbox was packed into the wrong box.
- Replace SMP real CPU group enable with individual real CPU enables.
I've had requests for this feature from people with 24 - 32 cpu machines
where there is insufficient vertical space for all cpu charts and they
want to split the CPU charts into multiple gkrellm stacks with --config.
- Add option to show/hide CPU panel labels so only a krell can be in the
panels. Not showing CPU panel labels saves vertical space - for systems
with medium to large numbers of CPUs. I find it useful with 4+ CPUs.
To make up for no panel label, added new chart label format string options
that draw the CPU label on the chart.
Temp and fan sensors cannot be relocated to CPU panels if labels not shown.
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.
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).
- Export the CC and PKG_CONFIG variables before calling configure scripts,
especially for cross compilation and modified environments, otherwise
configure might detect libraries that are not usable by the compiler
later on
- Replace the hardcoded pkg-config calls in configure with a variable
that may be overridden by Makefile
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).
Apply a slightly modified version of a patch provided by Pierre Neyron
that allows to enable/disable new network interfaces by default.
This feature is especially helpful for VM or container setups where many
network interfaces are created.
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
The remaining codebase uses g_strdup() already so do the same for the
chime command too. This fixes a gcc warning caused by a missing include
for strdup().
Move all variable and struct init code into if 0 blocks like the code
that is supposed to use this. Eventually this whole cruft can be
dropped altogether in case GKrellM can be ported to use Gtk+ session
management.
- Adding a sensor in the mbmon support stored the added sensor in a
pointer but never used it afterwards
- Drop pixbuf width in draw_left_frame_overlap, the code unlike other
drawing helpers does not use the pixbuf width
- Remove unused scroll selection from net_stats_page
This fixes several set but unread warnings when compiling with a recent
gcc (encountered with gcc 4.8.2).
Read sensor information from the GPU-Z shared memory area if present.
As with all sensor backends on Windows this needs the GPU-Z tool
running in the background.
Do not use a fixed 5 second delay after having a started a windows
sensor application, instead try to access the shared memory area
repeatedly and only give up after 10 seconds. Please note that for this
feature to be usable the sensor app must be found in PATH.
- Move opening and closing of a win32 shared memory area into helper
functions. shm_open ensures that the data pointer is valid and
otherwise gets rid of the opened file handle right away. shm_close
cleans up both the handle and the data pointer if needed.
- Redo the initial check for presence of a sensor tool that uses a
shared memory area for its sensor data by using the above two
functions
- Port all sensor value reading to use shm_open/shm_close as well
This gets rid of some code duplication and also lowers the indentation
level in several areas which hopefully makes the code a bit easier to
read. Additionally all the win32 API calls are limited to two functions.
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.
On Thinkpads T410s sysfs may switch between energy_full/_now and
charge_full/_now files across suspend/resume. Instead of polling only
one set of files always try all variants when checking battery levels.
This fixes a battery level of 0 in GKrellM after resume.
Thanks to Joern Engel for tracking this down and for providing a patch
via the Debian bugtracker.
See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630117
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.