diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-09-22 12:50:27 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-09-24 08:38:03 -0400 |
commit | 585314e84c1a2e8941309874088963985e063213 (patch) | |
tree | bdedaa2f07bc52ff5b02d6f51b3dde8f3e727d52 /src/journal/journalctl.c | |
parent | dd144c63e285e35149f80b1a41af548ad040c037 (diff) |
journalctl: reset cached column count on SIGWINCH
This requires a little bit of tip-toeing around to explicitly avoid
touching the environment from a sig handler. Instead, simply create a
function to reset the var to its "unset" state, allowing the next call
to columns() to recalculate and cache the new value.
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r-- | src/journal/journalctl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 6b580d4307..e491c27662 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -29,6 +29,7 @@ #include <sys/poll.h> #include <time.h> #include <getopt.h> +#include <signal.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <linux/fs.h> @@ -175,6 +176,7 @@ static int parse_argv(int argc, char *argv[]) { case 'f': arg_follow = true; + signal(SIGWINCH, columns_cache_reset); break; case 'o': |