diff options
Diffstat (limited to 'qarshd.c')
-rw-r--r-- | qarshd.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -112,15 +112,15 @@ run_cmd(const char *cmd, int p_in, int p_out, int p_err) return pid; } -ssize_t -recvfile(const char *path, int if_port, size_t count, mode_t mode) +off_t +recvfile(const char *path, int if_port, off_t count, mode_t mode) { int sd; int ofd; char buf[BUFSIZ]; - ssize_t nread; - ssize_t nwrote; - ssize_t nleft; + off_t nread; + off_t nwrote; + off_t nleft; /* Read count bytes from ifd (sd after we connect), * write into file @ path @@ -156,7 +156,7 @@ recvfile(const char *path, int if_port, size_t count, mode_t mode) if (nleft != 0) { unlink(path); syslog(LOG_WARNING, "Short file transfer in recvfile(), " - "%zd bytes lost, wanted %zd\n", nleft, count); + "%lld bytes lost, wanted %lld\n", nleft, count); } close(sd); @@ -232,7 +232,7 @@ handle_packets(int infd) pid_t child_pid = 0; int child_status; - ssize_t nbytes; + off_t nbytes; sigemptyset(&sigmask); sigaddset(&sigmask, SIGCHLD); @@ -271,6 +271,7 @@ handle_packets(int infd) syslog(LOG_DEBUG, "That's enough\n"); break; } + dump_qp(qp); switch (qp->qp_type) { case QP_KILL: if (child_pid) { @@ -298,7 +299,7 @@ handle_packets(int infd) break; case QP_RECVFILE: syslog(LOG_INFO, "Got a QP_RECVFILE with path = %s, " - "ifd = %d, count = %zd, mode = %o\n", + "ifd = %d, count = %lld, mode = %o\n", qp->qp_recvfile.qp_path, qp->qp_recvfile.qp_if_port, qp->qp_recvfile.qp_count, @@ -311,7 +312,7 @@ handle_packets(int infd) rp = make_qp_returncode(-1, errno, strerror(errno)); } else if (nbytes < qp->qp_recvfile.qp_count) { char tmpstr[512]; - sprintf(tmpstr, "Excpected %zd, wrote %zd\n", + sprintf(tmpstr, "Excpected %lld, wrote %lld\n", qp->qp_recvfile.qp_count, nbytes); rp = make_qp_returncode(-1, 0, tmpstr); } else { |