Add warn() and die()
authorLaslo Hunhold <dev@frign.de>
Fri, 18 May 2018 08:59:05 +0000 (10:59 +0200)
committerAaron Marcher <me@drkhsh.at>
Fri, 18 May 2018 09:13:05 +0000 (11:13 +0200)
commit80fc20d1d69b14f36ad9bb64d8af38481cbf1ff5
treeecd06a739fc89f6041aa2d84073f5bc1e0a0bad9
parenta4fe8c97414f07dd8b891e0d325dd2733195151d
Add warn() and die()

Given slstatus is a tool that runs in the background, most likely run
from .xinitrc, it's important to prepend the name of the tool to error
messages so it becomes clear where the error is coming from.

To make this much more consistent, this commit adds warn() and die()
utility functions consistent with other suckless projects and adapts all
calls to fprintf(stderr, *) to the warn() and die() functions, greatly
increasing the readability of the code.
20 files changed:
components/battery.c
components/cpu.c
components/datetime.c
components/disk.c
components/hostname.c
components/ip.c
components/kernel_release.c
components/keyboard_indicators.c
components/load_avg.c
components/num_files.c
components/run_command.c
components/swap.c
components/temperature.c
components/uptime.c
components/user.c
components/volume.c
components/wifi.c
slstatus.c
util.c
util.h