diff options
Diffstat (limited to 'libvxi11client/perlbits/perlglue.c')
-rw-r--r-- | libvxi11client/perlbits/perlglue.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libvxi11client/perlbits/perlglue.c b/libvxi11client/perlbits/perlglue.c index 5c6448b..096f7a7 100644 --- a/libvxi11client/perlbits/perlglue.c +++ b/libvxi11client/perlbits/perlglue.c @@ -64,7 +64,7 @@ int glue_stop_interrupt_server() { return ret; } -char* glue_wait_for_interrupt(unsigned int timeout) { +char* glue_wait_for_interrupt(int timeout) { if (interruptqueue == NULL ) { #ifdef DEBUG printf("interrupt queue is null!\n"); @@ -82,7 +82,10 @@ char* glue_wait_for_interrupt(unsigned int timeout) { g_time_val_add(&whentotimeout, timeout * 1000); lastevent = (Event*) g_async_queue_timed_pop(interruptqueue, &whentotimeout); } - else { + else if (timeout == 0) { + lastevent = (Event*) g_async_queue_try_pop(interruptqueue); + } + else if (timeout == -1) { lastevent = (Event*) g_async_queue_pop(interruptqueue); } |