aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-28 20:34:50 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-28 20:34:50 +0100
commit4e8a81872679c3f01c344451da839523b8640f0f (patch)
tree7433b3753f484bf72ce0f2e913a8807feaf154e7
parentm + receive messages (diff)
downloadsat-4e8a81872679c3f01c344451da839523b8640f0f.tar.gz
sat-4e8a81872679c3f01c344451da839523b8640f0f.tar.bz2
sat-4e8a81872679c3f01c344451da839523b8640f0f.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r--src/daemon.h1
-rw-r--r--src/satd-add.c1
-rw-r--r--src/satd-diminished.c1
-rw-r--r--src/satd-list.c2
-rw-r--r--src/satd-rm.c1
-rw-r--r--src/satd-run.c1
-rw-r--r--src/satd.c1
7 files changed, 5 insertions, 3 deletions
diff --git a/src/daemon.h b/src/daemon.h
index e56fa76..6b968ba 100644
--- a/src/daemon.h
+++ b/src/daemon.h
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <stddef.h>
+#include <sys/socket.h>
diff --git a/src/satd-add.c b/src/satd-add.c
index f7f2554..e143c00 100644
--- a/src/satd-add.c
+++ b/src/satd-add.c
@@ -43,6 +43,7 @@ main(int argc, char *argv[])
/* 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);
msg_argc = *(int *)(message + n);
diff --git a/src/satd-diminished.c b/src/satd-diminished.c
index d9efcf2..3a42fba 100644
--- a/src/satd-diminished.c
+++ b/src/satd-diminished.c
@@ -26,7 +26,6 @@
#include <signal.h>
#include <sys/wait.h>
#include <sys/stat.h>
-#include <sys/socket.h>
#include "daemon.h"
diff --git a/src/satd-list.c b/src/satd-list.c
index 7cbc2bb..a7d13e3 100644
--- a/src/satd-list.c
+++ b/src/satd-list.c
@@ -38,10 +38,10 @@ main(int argc, char *argv[])
{
size_t n = 0;
char *message = NULL;
- char **msg_argv = NULL;
/* Receive and validate message. */
t (readall(SOCK_FILENO, &message, &n) || n);
+ shutdown(SOCK_FILENO, SHUT_RD);
return 0;
fail:
diff --git a/src/satd-rm.c b/src/satd-rm.c
index 6c4ed38..6a9f6cd 100644
--- a/src/satd-rm.c
+++ b/src/satd-rm.c
@@ -42,6 +42,7 @@ main(int argc, char *argv[])
/* Receive and validate message. */
t (readall(SOCK_FILENO, &message, &n) || !n || message[n - 1]);
+ shutdown(SOCK_FILENO, SHUT_RD);
msg_argv = restore_array(message, n, NULL);
t (!msg_argv);
diff --git a/src/satd-run.c b/src/satd-run.c
index a2679bb..7cccb57 100644
--- a/src/satd-run.c
+++ b/src/satd-run.c
@@ -42,6 +42,7 @@ main(int argc, char *argv[])
/* Receive and validate message. */
t (readall(SOCK_FILENO, &message, &n) || (n && message[n - 1]));
+ shutdown(SOCK_FILENO, SHUT_RD);
if (n) {
msg_argv = restore_array(message, n, NULL);
t (!msg_argv);
diff --git a/src/satd.c b/src/satd.c
index bd927cd..42a2074 100644
--- a/src/satd.c
+++ b/src/satd.c
@@ -24,7 +24,6 @@
#include <pwd.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/socket.h>
#include <sys/un.h>
#include <sys/file.h>