Commit Graph

693 Commits

Author SHA1 Message Date
Antonio Huete Jimenez
afd7e44d97 Detect interface type on DragonFly BSD 2018-07-15 21:59:18 +00:00
Ingo Bürk
fc9da67e65
Merge pull request #297 from Stunkymonkey/percent-first
able to print percentage
2018-07-13 15:17:51 +02:00
Felix Buehler
52e9f6f63b able to print percentage
its now possible to have percentage before and after a variable. except
for the date. But percentage with dates does not make much sense to me, so
i skipped it.
2018-07-13 15:03:31 +02:00
Ingo Bürk
9aafc38370
Merge pull request #256 from oyvinht/master
Read multiple batteries on DragonFly BSD.
2018-07-13 12:31:04 +02:00
Ingo Bürk
c7f04b7447
Merge pull request #295 from Stunkymonkey/fix-min_width-docs
fix min_width doc
2018-07-13 12:27:28 +02:00
Felix Buehler
530c6f01d3 fix min_width doc 2018-07-07 22:57:39 +02:00
Ingo Bürk
c5ad20bf50
Merge pull request #294 from Stunkymonkey/remove_memory_discussion
forgot to remove memory discussion from man page (it is implemented)
2018-06-30 06:52:58 +02:00
Felix Buehler
4e62a853ee forgot to remove memory discussion from man page (it is implemented) 2018-06-30 00:52:59 +02:00
Ingo Bürk
302966374b
Merge pull request #292 from Stunkymonkey/format_quality
add format_quality option in wireless
2018-06-29 23:10:53 +02:00
Felix Buehler
4ea804b751 add format_quality option in wireless 2018-06-29 22:56:09 +02:00
Ingo Bürk
78c0a53c45
Merge pull request #293 from Stunkymonkey/hide_seconds_battery
hide seconds in battery by default
2018-06-29 22:49:52 +02:00
Ingo Bürk
a916481aab
Merge pull request #291 from duskCoder/cap_net_admin
Stop requiring CAP_NET_ADMIN
2018-06-29 22:43:39 +02:00
Felix Buehler
50b899ba42 hide seconds in battery by default 2018-06-29 14:37:48 +02:00
Olivier Gayot
03c8908ec6 Stop requiring CAP_NET_ADMIN
Since the following commit in the Linux kernel tree

  0fdc100bdc4b ethtool: allow non-netadmin to query settings

it is no longer necessary to have the CAP_NET_ADMIN capability to query
a device speed using ioctl(..., SIOCETHTOOL) in conjonction with the
ETHTOOL_GSET ethtool command.

The mentioned commit landed first in the 2.6.37 version of the Kernel.
This version is no longer maintained nowdays.

Since it is not necessary anymore, it is strongly prefered from a
security standpoint to drop the CAP_NET_ADMIN capability from the
binary.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-25 11:53:05 +02:00
Ingo Bürk
4d3344ab9c
Merge pull request #290 from duskCoder/changes
Fix potential issues & avoid unnecessary instructions
2018-06-22 13:55:09 +02:00
Olivier Gayot
c221b4d331 Prevent potential crash if glob() fails
Calling globfree(NULL) is undefined behaviour. In Linux (glibc), it
results in a segmentation fault.

It is also undefined behaviour to call globfree(&pglob) if a previous
call to glob(&pglob) returned an error.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
445b1925e3 Fix potential memory leak on Linux
The function slurp_all_batteries(), on Linux, allocates memory
dynamically

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
c64195d147 Fix invalid handling of glob() errors on Linux
The manual of glob(3) says that the function returns 0 on successful
completion. Any other integer value should be considered an error, not
only negative integers.

In practice, *BSD systems use negative values but Linux uses positive
integers.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
95c068358a Fix use of undefined macro __OpenBSD__
Compiling on Linux with -Wundef produces the following warning:

  warning: "__OpenBSD__" is not defined, evaluates to 0 [-Wundef]

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
a6dd14c8c6 Avoid assigning a new value to a var before using the old value
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
598b76cc53 Make sure the arguments passed to printf/die(...) match the format
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Olivier Gayot
ca8c3e7337 No longer use a temporary buffer in the die() function
Before the following change

  f947d0a Breaks configfiles! Major refactoring of i3status, see below

The die(fmt, ...) function was outputting the reason to the status bar
in addition to stderr. For this reason, it was meaningful to create a
temporary string according to the format string and then passing it
around to the different functions.

Nowadays, we only display the error message to stderr so calling
fprintf(stderr, ...) is much simpler.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 11:01:59 +02:00
Ingo Bürk
64fd6e1047
Merge pull request #289 from bebehei/testsuite
Testsuite
2018-06-20 08:39:59 +02:00
Benedikt Heine
bffc9ed962 Show differing results, if testcase fails 2018-06-19 17:17:51 +02:00
Benedikt Heine
a073acd406 Run all travis tests and expose the final result as exit code 2018-06-19 17:17:51 +02:00
Benedikt Heine
adc9348e80 Expose the testsuite in the Makefile 2018-06-19 17:17:51 +02:00
Benedikt Heine
bc29d468ca Fail the tests, if i3status actually crashes 2018-06-19 16:47:02 +02:00
Ingo Bürk
f300f6e466
Merge pull request #287 from eplanet/emeric/man_typo
Fix man typo
2018-06-16 14:49:09 +02:00
eplanet
5b4eb1069d Fix man typo 2018-06-14 22:09:03 +02:00
Ingo Bürk
ac78e1abe3
Merge pull request #286 from duskCoder/#283
Fix issue #283 (shown IP belonging to wrong network interface)
2018-06-11 22:18:53 +02:00
Olivier Gayot
451ff9be0b Fix shown IP address belonging to wrong interface
The following commit:

  6a75ea9 Show IP address when address has a label

introduced a way to show the IP address of an interface when a label is
associated to the IP.

When a label is associated to an IP, the structure returned by
getifaddrs() has the label concatenated to the interface name in the
.ifa_name field as in the following example:

    struct ifaddrs ifaddr = {
       .ifa_name = "eth0:mylabel",
    };

As a consequence, using a strict comparison between the interface nam