summaryrefslogtreecommitdiff
path: root/libvxi11client
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-29 01:04:04 +0900
committerdaniel <danieruru@gmail.com>2013-01-29 01:04:04 +0900
commite15319368bf6d69fe84dc5afa63f740252c8dfcc (patch)
treee6d8291e5c9cbfc2c9c655f268486834670c1034 /libvxi11client
parente183a9956be3c9ad3cb50c56a634041ece49e41a (diff)
Endian fixes.
Diffstat (limited to 'libvxi11client')
-rw-r--r--libvxi11client/libvxi11client.c9
-rw-r--r--libvxi11client/perlbits/perlglue.c3
-rwxr-xr-xlibvxi11client/perlbits/testscript.pl5
3 files changed, 12 insertions, 5 deletions
diff --git a/libvxi11client/libvxi11client.c b/libvxi11client/libvxi11client.c
index 0e01809..219a17f 100644
--- a/libvxi11client/libvxi11client.c
+++ b/libvxi11client/libvxi11client.c
@@ -384,8 +384,10 @@ static gpointer interruptthreadfunc(gpointer data) {
return 0;
}
+ interruptserverport = transp->xp_port;
+
#ifdef DEBUG
- printf("Interrupt channel on port %d tcp\n", transp->xp_port);
+ printf("Interrupt channel on port %d tcp\n", interruptserverport);
#endif
if (!svc_register(transp, DEVICE_INTR, DEVICE_INTR_VERSION, device_intr_1, 0)) {
@@ -393,7 +395,6 @@ static gpointer interruptthreadfunc(gpointer data) {
return 0;
}
- interruptserverport = transp->xp_port;
g_mutex_lock(mutex);
g_cond_signal(cond);
g_mutex_unlock(mutex);
@@ -501,8 +502,8 @@ int vxi11_create_intr_chan(VXI11Context* context) {
struct sockaddr_in myaddress;
get_myaddress(&myaddress);
- Device_RemoteFunc remotefunc = { .hostAddr = myaddress.sin_addr.s_addr, .hostPort = interruptserverport, .progNum =
- DEVICE_INTR, .progVers = DEVICE_INTR_VERSION, .progFamily = DEVICE_TCP };
+ Device_RemoteFunc remotefunc = { .hostAddr = ntohl(myaddress.sin_addr.s_addr), .hostPort = interruptserverport,
+ .progNum = DEVICE_INTR, .progVers = DEVICE_INTR_VERSION, .progFamily = DEVICE_TCP };
Device_Error* error = create_intr_chan_1(&remotefunc, context->clnt);
if (error != NULL && error->error == 0) {
context->interruptchannelopen = true;
diff --git a/libvxi11client/perlbits/perlglue.c b/libvxi11client/perlbits/perlglue.c
index dec97c2..7807895 100644
--- a/libvxi11client/perlbits/perlglue.c
+++ b/libvxi11client/perlbits/perlglue.c
@@ -56,10 +56,13 @@ int glue_stop_interrupt_server() {
}
freelast();
g_async_queue_unref(interruptqueue);
+ interruptqueue = NULL;
return ret;
}
char* glue_wait_for_interrupt() {
+ if (interruptqueue)
+ return NULL;
GTimeVal timeout;
g_get_current_time(&timeout);
g_time_val_add(&timeout, 2500);
diff --git a/libvxi11client/perlbits/testscript.pl b/libvxi11client/perlbits/testscript.pl
index ae23e79..ac7dd3f 100755
--- a/libvxi11client/perlbits/testscript.pl
+++ b/libvxi11client/perlbits/testscript.pl
@@ -19,7 +19,10 @@ printf "status byte is " . $statusbyte . "\n";
$instr->vxi_create_intr_chan();
$instr->vxi_enable_srq("myhandle");
-vxi_wait_for_interrupt();
+
+for (my $i = 0; $i < 10000; $i++) {
+ vxi_wait_for_interrupt();
+}
$instr->vxi_disable_srq();
$instr->vxi_destroy_intr_chan();
$instr->vxi_abort();