projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Two related changes to timing code:
[u/mdw/putty]
/
windows
/
winsftp.c
diff --git
a/windows/winsftp.c
b/windows/winsftp.c
index
de84997
..
d4c5fa6
100644
(file)
--- a/
windows/winsftp.c
+++ b/
windows/winsftp.c
@@
-88,7
+88,8
@@
struct RFile {
};
RFile *open_existing_file(char *name, uint64 *size,
};
RFile *open_existing_file(char *name, uint64 *size,
- unsigned long *mtime, unsigned long *atime)
+ unsigned long *mtime, unsigned long *atime,
+ long *perms)
{
HANDLE h;
RFile *ret;
{
HANDLE h;
RFile *ret;
@@
-113,6
+114,9
@@
RFile *open_existing_file(char *name, uint64 *size,
TIME_WIN_TO_POSIX(wrtime, *mtime);
}
TIME_WIN_TO_POSIX(wrtime, *mtime);
}
+ if (perms)
+ *perms = -1;
+
return ret;
}
return ret;
}
@@
-137,7
+141,7
@@
struct WFile {
HANDLE h;
};
HANDLE h;
};
-WFile *open_new_file(char *name)
+WFile *open_new_file(char *name
, long perms
)
{
HANDLE h;
WFile *ret;
{
HANDLE h;
WFile *ret;
@@
-482,15
+486,20
@@
extern int select_result(WPARAM, LPARAM);
int do_eventsel_loop(HANDLE other_event)
{
int n, nhandles, nallhandles, netindex, otherindex;
int do_eventsel_loop(HANDLE other_event)
{
int n, nhandles, nallhandles, netindex, otherindex;
- long next, ticks;
+ unsigned long next, then;
+ long ticks;
HANDLE *handles;
SOCKET *sklist;
int skcount;
HANDLE *handles;
SOCKET *sklist;
int skcount;
- long now = GETTICKCOUNT();
+
unsigned
long now = GETTICKCOUNT();
if (run_timers(now, &next)) {
if (run_timers(now, &next)) {
- ticks = next - GETTICKCOUNT();
- if (ticks < 0) ticks = 0; /* just in case */
+ then = now;
+ now = GETTICKCOUNT();
+ if (now - then > next - then)
+ ticks = 0;
+ else
+ ticks = next - now;
} else {
ticks = INFINITE;
}
} else {
ticks = INFINITE;
}