diff options
Diffstat (limited to '')
-rw-r--r-- | src/client.h | 37 | ||||
-rw-r--r-- | src/satd-diminished.c | 28 |
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; |