diff options
author | Bert Münnich <ber.t@posteo.de> | 2014-01-08 21:14:01 +0100 |
---|---|---|
committer | Bert Münnich <ber.t@posteo.de> | 2014-01-08 21:14:01 +0100 |
commit | 9632dd88b97c0051ba43c82a3eb26bc2694489a0 (patch) | |
tree | fd672dc894b732b4ce0fcf908d9ef924886f8722 /main.c | |
parent | 9574150f2d54790a9482e9c49f118f99ab84c552 (diff) |
Fixup for 9574150
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -459,7 +459,7 @@ void key_handler(const char *key, unsigned int mask) pid_t pid; int retval, status, n = mode == MODE_IMAGE ? fileidx : tns.sel; char *cmd = exec[EXEC_KEY].cmd, kstr[32]; - struct stat oldstat, newstat; + struct stat oldst, newst; if (cmd == NULL || key == NULL) return; @@ -469,7 +469,7 @@ void key_handler(const char *key, unsigned int mask) mask & Mod1Mask ? "M-" : "", mask & ShiftMask ? "S-" : "", key); - stat(files[n].path, &oldstat); + stat(files[n].path, &oldst); if ((pid = fork()) == 0) { execl(cmd, cmd, kstr, files[n].path, NULL); @@ -486,10 +486,12 @@ void key_handler(const char *key, unsigned int mask) if (WIFEXITED(status) == 0 || retval != 0) warn("key handler exited with non-zero return value: %d", retval); - if (stat(files[n].path, &newstat) == 0 && - memcmp(&oldstat, &newstat, sizeof(oldstat)) == 0) + if (stat(files[n].path, &newst) == 0 && + memcmp(&oldst.st_mtime, &newst.st_mtime, sizeof(oldst.st_mtime)) == 0) { /* file has not changed */ + win_set_cursor(&win, CURSOR_ARROW); + set_timeout(reset_cursor, TO_CURSOR_HIDE, true); return; } if (mode == MODE_IMAGE) { |