projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch from Brad Smith to use posix_openpt() instead of
[u/mdw/putty]
/
unix
/
gtkwin.c
diff --git
a/unix/gtkwin.c
b/unix/gtkwin.c
index
241aa6b
..
bd69fb6
100644
(file)
--- a/
unix/gtkwin.c
+++ b/
unix/gtkwin.c
@@
-1400,13
+1400,18
@@
void notify_remote_exit(void *frontend)
static gint timer_trigger(gpointer data)
{
static gint timer_trigger(gpointer data)
{
- long now = GPOINTER_TO_LONG(data);
-
long next
;
+
unsigned
long now = GPOINTER_TO_LONG(data);
+
unsigned long next, then
;
long ticks;
if (run_timers(now, &next)) {
long ticks;
if (run_timers(now, &next)) {
- ticks = next - GETTICKCOUNT();
- timer_id = gtk_timeout_add(ticks > 0 ? ticks : 1, timer_trigger,
+ then = now;
+ now = GETTICKCOUNT();
+ if (now - then > next - then)
+ ticks = 0;
+ else
+ ticks = next - now;
+ timer_id = gtk_timeout_add(ticks, timer_trigger,
LONG_TO_GPOINTER(next));
}
LONG_TO_GPOINTER(next));
}
@@
-1417,7
+1422,7
@@
static gint timer_trigger(gpointer data)
return FALSE;
}
return FALSE;
}
-void timer_change_notify(long next)
+void timer_change_notify(
unsigned
long next)
{
long ticks;
{
long ticks;
@@
-2587,6
+2592,13
@@
static void help(FILE *fp) {
}
}
}
}
+static void version(FILE *fp) {
+ if(fprintf(fp, "%s: %s\n", appname, ver) < 0 || fflush(fp) < 0) {
+ perror("output error");
+ exit(1);
+ }
+}
+
int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
struct gui_data *inst, Conf *conf)
{
int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
struct gui_data *inst, Conf *conf)
{
@@
-2796,6
+2808,10
@@
int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
help(stdout);
exit(0);
help(stdout);
exit(0);
+ } else if(!strcmp(p, "-version") || !strcmp(p, "--version")) {
+ version(stdout);
+ exit(0);
+
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);