Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ftpd: bad ret



Hi,
fstat() returns -1 on error, not 0.

Index: ftpd.c
===================================================================
RCS file: /cvsroot/src/libexec/ftpd/ftpd.c,v
retrieving revision 1.199
diff -u -r1.199 ftpd.c
--- ftpd.c      3 Jul 2013 14:16:01 -0000       1.199
+++ ftpd.c      31 Jul 2013 13:27:39 -0000
@@ -2392,7 +2392,7 @@
                (void) alarm(curclass.timeout);
                if (curclass.readsize)
                        readsize = curclass.readsize;
-               else if (fstat(filefd, &st))
+               else if (fstat(filefd, &st) != -1)
                        readsize = (ssize_t)st.st_blksize;
                else
                        readsize = BUFSIZ;


Home | Main Index | Thread Index | Old Index