server: Change the timeout handling to use NT-style 64-bit timeouts everywhere.
diff --git a/server/serial.c b/server/serial.c
index d677d17..628db5a 100644
--- a/server/serial.c
+++ b/server/serial.c
@@ -180,7 +180,7 @@
static void serial_queue_async( struct fd *fd, const async_data_t *data, int type, int count )
{
struct serial *serial = get_fd_user( fd );
- int timeout = 0;
+ timeout_t timeout = 0;
struct async *async;
assert(serial->obj.ops == &serial_ops);
@@ -188,21 +188,16 @@
switch (type)
{
case ASYNC_TYPE_READ:
- timeout = serial->readconst + serial->readmult*count;
+ timeout = serial->readconst + (timeout_t)serial->readmult*count;
break;
case ASYNC_TYPE_WRITE:
- timeout = serial->writeconst + serial->writemult*count;
+ timeout = serial->writeconst + (timeout_t)serial->writemult*count;
break;
}
if ((async = fd_queue_async( fd, data, type, count )))
{
- if (timeout)
- {
- struct timeval when = current_time;
- add_timeout( &when, timeout );
- async_set_timeout( async, &when, STATUS_TIMEOUT );
- }
+ if (timeout) async_set_timeout( async, timeout * -10000, STATUS_TIMEOUT );
release_object( async );
set_error( STATUS_PENDING );
}