aboutsummaryrefslogtreecommitdiffstats
path: root/src/satd-add.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-29 00:59:19 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-29 00:59:19 +0100
commitd679ea3129781ef564c1f91194104ce7692bb102 (patch)
tree966f69d63bd1c5b1229aa99ee4378e6e0f50e74d /src/satd-add.c
parentreopen state file, we will use flock on it, so all processes need their own open file descriptor for it (diff)
downloadsat-d679ea3129781ef564c1f91194104ce7692bb102.tar.gz
sat-d679ea3129781ef564c1f91194104ce7692bb102.tar.bz2
sat-d679ea3129781ef564c1f91194104ce7692bb102.tar.xz
fix errors
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/satd-add.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/satd-add.c b/src/satd-add.c
index 497e32d..0d7d777 100644
--- a/src/satd-add.c
+++ b/src/satd-add.c
@@ -39,22 +39,26 @@ main(int argc, char *argv[])
size_t n = 0, elements = 0, i;
char *message = NULL;
int msg_argc;
- char **msg = NULL;
- t (reopen(STATE_FILENO, O_RDRW));
+ assert(argc == 4);
+ t (reopen(STATE_FILENO, O_RDWR));
/* Receive and validate message. */
t (readall(SOCK_FILENO, &message, &n));
shutdown(SOCK_FILENO, SHUT_RD);
- t (n < sizeof(int) + sizeof(clk) + sizeof(ts));
- n -= sizeof(int) + sizeof(clk) + sizeof(ts);
+ t (n < sizeof(int) + sizeof(clockid_t) + sizeof(struct timespec));
+ n -= sizeof(int) + sizeof(clockid_t) + sizeof(struct timespec);
msg_argc = *(int *)(message + n);
t ((msg_argc < 1) || !n || message[n - 1]);
for (i = n; i--; elements += !message[i]);
t (elements < (size_t)msg_argc);
- n += sizeof(int) + sizeof(clk) + sizeof(ts);
+ n += sizeof(int) + sizeof(clockid_t) + sizeof(struct timespec);
+
+ (void) argv;
return 0;
fail:
+
+ (void) argc;
}