watch: exit cleanly when falling through main loop.
Revert commitffe5e0b08e
. Restores clean exit when falling through main loop. Previously, watch only exited when there was an error or when interrupted by the user. Commit81f64657ba
added another exit condition when the watched command's output changes, causing execution to fall out of the main loop. With this change, watch correctly restores the terminal and returns an exit code indicating success when invoked with the --chgexit/-g options.
This commit is contained in:
4
watch.c
4
watch.c
@ -739,5 +739,7 @@ int main(int argc, char *argv[])
|
||||
usleep(interval * 1000000);
|
||||
} while (!exit_early);
|
||||
|
||||
return EXIT_FAILURE;
|
||||
endwin();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user