Bugfix: Exit upon errors from printf in dzen2-mode (usually SIGPIPE because dzen2 exited)

This prevents i3status processes from still running on your system
after you’ve restarted X and dzen2 is long gone.
This commit is contained in:
Michael Stapelberg 2009-06-16 18:43:13 +02:00
parent 15977d8a17
commit 747c814453

View File

@ -221,11 +221,18 @@ static void setup(void) {
static void write_to_statusbar(const char *name, const char *message, bool final_entry) {
#ifdef DZEN
if (final_entry) {
(void)printf("%s^p(6)\n", message);
if (printf("%s^p(6)\n", message) < 0) {
perror("printf");
exit(1);
}
fflush(stdout);
return;
}
(void)printf("%s" BAR, message);
if (printf("%s" BAR, message) < 0) {
perror("printf");
exit(1);
}
return;
#endif