aboutsummaryrefslogtreecommitdiffstats
path: root/src/client.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-29 16:04:45 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-29 16:04:45 +0100
commit98d15bdfc7ae70f89f58d46b1727aed19ceaf387 (patch)
tree762d155dcd0865a0fda43b70fe490be85beee994 /src/client.c
parentadd build system + add news file + update deps (diff)
downloadsat-98d15bdfc7ae70f89f58d46b1727aed19ceaf387.tar.gz
sat-98d15bdfc7ae70f89f58d46b1727aed19ceaf387.tar.bz2
sat-98d15bdfc7ae70f89f58d46b1727aed19ceaf387.tar.xz
fix warnings
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/client.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/client.c b/src/client.c
index 6da3b39..026813b 100644
--- a/src/client.c
+++ b/src/client.c
@@ -53,7 +53,7 @@ send_command(enum command cmd, size_t n, const char *restrict msg)
{
struct sockaddr_un address;
int fd = -1, start = 1, status, outfd, goterr = 0;
- char *dir;
+ const char *dir;
pid_t pid;
ssize_t r, wrote;
char *buf = NULL;
@@ -97,7 +97,7 @@ send_command(enum command cmd, size_t n, const char *restrict msg)
/* Create socket. */
t ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1);
- t (connect(fd, (struct sockaddr *)&address, sizeof(address)) == -1);
+ t (connect(fd, (struct sockaddr *)&address, (socklen_t)sizeof(address)) == -1);
/* Send message. */
t (write(fd, &cmd_, sizeof(cmd_)) < (ssize_t)sizeof(cmd_));
@@ -122,9 +122,8 @@ receive_again:
t (errno = 0, r == 0);
n -= (size_t)r;
for (dir = buf; r;) {
- t (wrote = write(outfd, dir, r), wrote <= 0);
- dir += (size_t)wrote;
- r -= (size_t)wrote;
+ t (wrote = write(outfd, dir, (size_t)r), wrote <= 0);
+ dir += wrote, r -= wrote;
}
}
free(buf), buf = NULL;