summaryrefslogtreecommitdiffstats
path: root/qarshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'qarshd.c')
-rw-r--r--qarshd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/qarshd.c b/qarshd.c
index a961086..8d79e79 100644
--- a/qarshd.c
+++ b/qarshd.c
@@ -118,8 +118,7 @@ recvfile(const char *path, int if_port, off_t count, mode_t mode)
int sd;
int ofd;
char buf[BUFSIZ];
- off_t nread;
- off_t nwrote;
+ ssize_t nread, nwrote;
off_t nleft;
/* Read count bytes from ifd (sd after we connect),
@@ -156,7 +155,9 @@ recvfile(const char *path, int if_port, off_t count, mode_t mode)
if (nleft != 0) {
unlink(path);
syslog(LOG_WARNING, "Short file transfer in recvfile(), "
- "%lld bytes lost, wanted %lld\n", nleft, count);
+ "%lld bytes lost, wanted %lld\n",
+ (long long int)nleft,
+ (long long int)count);
}
close(sd);
@@ -302,7 +303,7 @@ handle_packets(int infd)
"ifd = %d, count = %lld, mode = %o\n",
qp->qp_recvfile.qp_path,
qp->qp_recvfile.qp_if_port,
- qp->qp_recvfile.qp_count,
+ (long long int)qp->qp_recvfile.qp_count,
qp->qp_recvfile.qp_mode);
nbytes = recvfile(qp->qp_recvfile.qp_path,
qp->qp_recvfile.qp_if_port,
@@ -313,7 +314,8 @@ handle_packets(int infd)
} else if (nbytes < qp->qp_recvfile.qp_count) {
char tmpstr[512];
sprintf(tmpstr, "Excpected %lld, wrote %lld\n",
- qp->qp_recvfile.qp_count, nbytes);
+ (long long int)qp->qp_recvfile.qp_count,
+ (long long int)nbytes);
rp = make_qp_returncode(-1, 0, tmpstr);
} else {
rp = make_qp_returncode(0, 0, "Transfer Complete");