]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
RPC error handling now supports trb_errno
authorhadaq <hadaq>
Sun, 8 Jan 2012 19:57:05 +0000 (19:57 +0000)
committerhadaq <hadaq>
Sun, 8 Jan 2012 19:57:05 +0000 (19:57 +0000)
trbnetd/trbnetrpc.c

index 4d80d453fef1c9f530a093cc858f41175d2fa9e4..38d765e6b7f94b094be3fa5fee050b82c3678739 100644 (file)
@@ -5,10 +5,9 @@
 
 #include "trbnet.h"
 
-const char trbnet_version[] = "$Revision: 1.9 $  RPC";
+const char trbnet_version[] = "$Revision: 1.10 $  RPC";
 unsigned int trb_debug = 0;
 unsigned int trb_dma = 0;
-
 static CLIENT *trb_client = NULL;
 static char trb_server[128] = "";
 
@@ -38,9 +37,8 @@ int trb_connect(const char *server)
   if (trb_client == NULL) {
     /*
      * Couldn't establish connection with server.
-     * Print error message and stop.
      */
-    clnt_pcreateerror(trb_server);
+    trb_errno = rpc_createerr.cf_stat + 256;
     return -1;
   }
   
@@ -73,7 +71,7 @@ int trb_register_read(uint16_t trb_address,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -102,7 +100,7 @@ int trb_registertime_read(uint16_t trb_address,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -134,7 +132,7 @@ int trb_register_read_mem(uint16_t trb_address,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
   
@@ -166,7 +164,7 @@ int trb_registertime_read_mem(uint16_t trb_address,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -194,7 +192,7 @@ int trb_read_uid(uint16_t trb_address,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
   
@@ -220,7 +218,7 @@ int trb_register_write(uint16_t trb_address,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
   
@@ -251,7 +249,7 @@ int trb_register_write_mem(uint16_t trb_address,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -276,7 +274,7 @@ int trb_set_address(uint64_t uid,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
   
@@ -309,7 +307,7 @@ int trb_ipu_data_read(uint8_t type,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -334,7 +332,7 @@ int trb_send_trigger(uint8_t type,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
   
@@ -361,7 +359,7 @@ int trb_send_trigger_rich(uint8_t input,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -387,7 +385,7 @@ int fpga_register_read(uint32_t reg_address, uint32_t* value)
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
   
@@ -409,7 +407,7 @@ int fpga_register_write(uint32_t reg_address, uint32_t value)
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -431,7 +429,7 @@ int trb_fifo_flush(uint8_t channel)
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -453,7 +451,7 @@ int network_reset()
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }
 
@@ -486,7 +484,7 @@ int trb_register_modify(uint16_t trb_address,
      * An error occurred while calling the server.
      * Print error message and stop.
      */
-    clnt_perror(trb_client, trb_server);
+    trb_errno = status + 256;
     return -1;
   }