]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/fork.c
Fix C sequence point constraint violation
[netatalk.git] / etc / afpd / fork.c
index 319f33f2b727cf0239fc0b1382ca964a71361153..2216a45c1b32a0d40be5b89698a9a95bc8553ffc 100644 (file)
@@ -880,11 +880,9 @@ static int read_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, si
            an error. we can't do this with translation on. */
 #ifdef WITH_SENDFILE
         if (!(obj->options.flags & OPTION_NOSENDFILE)) {
-            if (dsi_stream_read_file(dsi,
-                                     ad_readfile_init(ofork->of_ad, eid, &offset, 0),
-                                     offset,
-                                     dsi->datasize) < 0) {
-                switch (errno) {
+            int fd = ad_readfile_init(ofork->of_ad, eid, &offset, 0);
+            if (dsi_stream_read_file(dsi, fd, offset, dsi->datasize) < 0) { 
+               switch (errno) {
                 case EINVAL:
                 case ENOSYS:
                     goto afp_read_loop;