Skip to content

Commit

Permalink
Merge pull request #75 from pinotree/fix-time-type
Browse files Browse the repository at this point in the history
Use time_t as type for time()
  • Loading branch information
phfaist committed Mar 24, 2024
2 parents fd1391b + 40d6fb8 commit febdeac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ void signal_act(int sig)
fprintf(ftty, "Interrupt\n");
if (ftty != stderr) fprintf(stderr, "*** Interrupt\n");

static long last_sigint_time = 0;
long curtime;
static time_t last_sigint_time = 0;
time_t curtime;
time(&curtime);
bool isInsisted = (curtime - last_sigint_time <= 2); // re-pressed Ctrl-C after less than 2 secs
if (!isInsisted && qApp != NULL) {
Expand Down

0 comments on commit febdeac

Please sign in to comment.