aboutsummaryrefslogtreecommitdiffstats
path: root/src/sat.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-28 20:25:21 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-28 20:25:21 +0100
commit24d9c657dd1043af74046df01dbec60235d32c87 (patch)
tree97ee1174488a5be1343c8f7eb58acbe385b8185d /src/sat.c
parent... (diff)
downloadsat-24d9c657dd1043af74046df01dbec60235d32c87.tar.gz
sat-24d9c657dd1043af74046df01dbec60235d32c87.tar.bz2
sat-24d9c657dd1043af74046df01dbec60235d32c87.tar.xz
m + receive messages
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/sat.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/sat.c b/src/sat.c
index afdd910..6766542 100644
--- a/src/sat.c
+++ b/src/sat.c
@@ -54,9 +54,6 @@ main(int argc, char *argv[], char *envp[])
struct timespec ts;
clockid_t clk;
char *msg = NULL;
- char **w;
- char **r;
- int removed_empty = 0;
size_t n;
if ((argc < 3) || (argv[1][0] == '-'))
@@ -90,24 +87,13 @@ main(int argc, char *argv[], char *envp[])
argc -= 2;
argv += 2;
- /* Remove empty environment entries */
- for (w = r = envp; *r; r++) {
- if (**r) {
- *w++ = *r;
- } else if (removed_empty == 0) {
- fprintf(stderr,
- "%s: warning: removed empty "
- "environment entry.\n", argv0);
- removed_empty = 0;
- }
- }
-
/* Construct message to send to the daemon. */
n = measure_array(argv) + measure_array(envp);
- t (!(msg = malloc(n + sizeof(clk) + sizeof(ts))));
+ t (!(msg = malloc(n + sizeof(int) + sizeof(clk) + sizeof(ts))));
store_array(store_array(msg, argv), envp);
- memcpy(msg + n, &clk, sizeof(clk)), n += sizeof(clk);
- memcpy(msg + n, &ts, sizeof(ts)), n += sizeof(ts);
+ memcpy(msg + n, &argc, sizeof(int)), n += sizeof(int);
+ memcpy(msg + n, &clk, sizeof(clk)), n += sizeof(clk);
+ memcpy(msg + n, &ts, sizeof(ts)), n += sizeof(ts);
/* Send job to daemon, start daemon if necessary. */
SEND(SAT_QUEUE, n, msg);