]> arthur.barton.de Git - netatalk.git/commitdiff
Fix C sequence point constraint violation
authorFrank Lahm <franklahm@googlemail.com>
Mon, 2 Apr 2012 11:35:24 +0000 (13:35 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 2 Apr 2012 11:35:24 +0000 (13:35 +0200)
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;