summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-09-02 14:18:28 +0000
committerache <ache@FreeBSD.org>2001-09-02 14:18:28 +0000
commit858507dd20c879468fc238539ebf127680df602e (patch)
tree5575c1e6d08ec9036376816382e4159d68a82560 /libexec
parent25567a30d1c20a36fb0b125f6b67c54d5bb963d6 (diff)
downloadFreeBSD-src-858507dd20c879468fc238539ebf127680df602e.zip
FreeBSD-src-858507dd20c879468fc238539ebf127680df602e.tar.gz
long -> off_t
long -> time_t %ld -> %qd fseek -> fseeko NOTE: that fseek not works for >long offsets per POSIX: [EOVERFLOW] For fseek( ), the resulting file offset would be a value which cannot be represented correctly in an object of type long.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 254282b..93f0a90 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -259,7 +259,7 @@ static struct passwd *
sgetpwnam __P((char *));
static char *sgetsave __P((char *));
static void reapchild __P((int));
-static void logxfer __P((char *, long, long));
+static void logxfer __P((char *, off_t, time_t));
static char *
curdir()
@@ -1550,7 +1550,7 @@ store(name, mode, unique)
* because we are changing from reading to
* writing.
*/
- if (fseek(fout, 0L, L_INCR) < 0) {
+ if (fseeko(fout, (off_t)0, SEEK_CUR) < 0) {
perror_reply(550, name);
goto done;
}
@@ -2834,8 +2834,8 @@ setproctitle(fmt, va_alist)
static void
logxfer(name, size, start)
char *name;
- long size;
- long start;
+ off_t size;
+ time_t start;
{
char buf[1024];
char path[MAXPATHLEN + 1];
@@ -2843,9 +2843,10 @@ logxfer(name, size, start)
if (statfd >= 0 && getwd(path) != NULL) {
time(&now);
- snprintf(buf, sizeof(buf), "%.20s!%s!%s!%s/%s!%ld!%ld\n",
+ snprintf(buf, sizeof(buf), "%.20s!%s!%s!%s/%s!%qd!%ld\n",
ctime(&now)+4, ident, remotehost,
- path, name, size, now - start + (now == start));
+ path, name, (long long)size,
+ (long)(now - start + (now == start)));
write(statfd, buf, strlen(buf));
}
}
OpenPOWER on IntegriCloud