summaryrefslogtreecommitdiff
path: root/vxi11_server.c
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-24 22:45:08 +0900
committerdaniel <danieruru@gmail.com>2013-01-24 22:45:08 +0900
commit5ca38c3d82fdca7be88787b951c832789c9b904e (patch)
tree57c93b5843b5686d1b376377535ac99f2ae46078 /vxi11_server.c
parentc21f92c559177c5d13e8dd1777fc30d8fc00457d (diff)
make read cleaner
Diffstat (limited to 'vxi11_server.c')
-rw-r--r--vxi11_server.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/vxi11_server.c b/vxi11_server.c
index 43d6ef3..ed529f2 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -189,11 +189,11 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) {
printf("device_read_1_svc()\n");
#endif
- if (result.data.data_val != NULL) {
+ // this free's the data from the last call
+ if (result.data.data_val != NULL)
g_free(result.data.data_val);
- result.data.data_val = NULL;
- result.data.data_len = 0;
- }
+
+ memset(&result, 0, sizeof(result));
if (!isValidLink(argp->lid))
result.error = ERR_INVALIDLINKINDENTIFIER;
@@ -211,11 +211,9 @@ device_read_1_svc(Device_ReadParms *argp, struct svc_req *rqstp) {
printf("sending ---%s---\n", result.data.data_val);
#endif
}
- else {
+ else
result.data.data_val = NULL;
- result.data.data_len = 0;
- }
- result.error = 0;
+
result.reason = 0x4;
}
return &result;