aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-28 15:36:40 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-28 15:36:40 +0100
commit6690f4c78b6b48c067fde6d14421c85e2b526303 (patch)
tree6cfa67140af096d3e9fdca6a02fdbe2327eff37c
parentsatd: exec to an image without init text (diff)
downloadsat-6690f4c78b6b48c067fde6d14421c85e2b526303.tar.gz
sat-6690f4c78b6b48c067fde6d14421c85e2b526303.tar.bz2
sat-6690f4c78b6b48c067fde6d14421c85e2b526303.tar.xz
...
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/client.h37
-rw-r--r--src/satd-diminished.c28
2 files changed, 46 insertions, 19 deletions
diff --git a/src/client.h b/src/client.h
index d341df6..900f6ec 100644
--- a/src/client.h
+++ b/src/client.h
@@ -26,28 +26,27 @@
/**
* Commands for `send_command`.
*/
-enum command
- {
- /**
- * Queue a job.
- */
- SAT_QUEUE = 0,
+enum command {
+ /**
+ * Queue a job.
+ */
+ SAT_QUEUE = 0,
- /**
- * Remove jobs.
- */
- SAT_REMOVE = 1,
+ /**
+ * Remove jobs.
+ */
+ SAT_REMOVE = 1,
- /**
- * Print job queue.
- */
- SAT_PRINT = 2,
+ /**
+ * Print job queue.
+ */
+ SAT_PRINT = 2,
- /**
- * Run jobs
- */
- SAT_RUN = 3
- };
+ /**
+ * Run jobs.
+ */
+ SAT_RUN = 3
+};
diff --git a/src/satd-diminished.c b/src/satd-diminished.c
index ed885c7..7120b45 100644
--- a/src/satd-diminished.c
+++ b/src/satd-diminished.c
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
+#include <sys/socket.h>
@@ -29,6 +30,27 @@
#define SOCK_FILENO 3
+/**
+ * Command: queue a job.
+ */
+#define SAT_QUEUE 0
+
+/**
+ * Command: remove jobs.
+ */
+#define SAT_REMOVE 1
+
+/**
+ * Command: print job queue.
+ */
+#define SAT_PRINT 2
+
+/**
+ * Command: run jobs.
+ */
+#define SAT_RUN 3
+
+
/**
* The sat daemon.
@@ -42,6 +64,12 @@
int
main(int argc, char *argv[])
{
+ int fd;
+
+ fd = accept(SOCK_FILENO. NULL, NULL);
+ shutdown(fd, SHUT_RDWR);
+ close(fd);
+
close(SOCK_FILENO);
unlink(argv[1]);
return 0;