summaryrefslogtreecommitdiffstats
path: root/src/readwrite.c
diff options
context:
space:
mode:
authorGravatar aeb 2001-01-19 01:11:48 +0000
committerGravatar aeb 2001-01-19 01:11:48 +0000
commite6015ce5e9be81881102e33ed3139fc11bb233cc (patch)
treedf9981bade81a4784f69f3f0da427a61ed4c2ee2 /src/readwrite.c
parentFix misplaced device file in Debian installation. (diff)
First implementation of new error reporting API.
git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@49 53a565d1-3bb7-0310-b661-cf11e63c67ab
Diffstat (limited to '')
-rw-r--r--src/readwrite.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/readwrite.c b/src/readwrite.c
index a983c30..c4a571b 100644
--- a/src/readwrite.c
+++ b/src/readwrite.c
@@ -120,14 +120,16 @@ int raw1394_start_iso_write(struct raw1394_handle *handle, unsigned int channel,
struct sync_cb_data sd = { 0, 0 }; \
struct raw1394_reqhandle rh = { (req_callback_t)_raw1394_sync_cb, \
&sd }; \
- int err
-
-#define SYNCFUNC_BODY \
- while (!sd.done) { \
- if (err < 0) return err; \
- err = raw1394_loop_iterate(handle); \
- } \
- return sd.errcode
+ int err = 0
+
+#define SYNCFUNC_BODY \
+ while (!sd.done) { \
+ if (err < 0) return err; \
+ err = raw1394_loop_iterate(handle); \
+ } \
+ handle->err = sd.errcode; \
+ errno = raw1394_errcode_to_errno(sd.errcode); \
+ return (errno ? -1 : 0)
int raw1394_read(struct raw1394_handle *handle, nodeid_t node, nodeaddr_t addr,
size_t length, quadlet_t *buffer)