From cefcacf44933d5a367a000d5c09472692b0b80a2 Mon Sep 17 00:00:00 2001 From: buffet Date: Wed, 16 Oct 2019 18:23:32 +0200 Subject: [PATCH] Remove kiwmic --- kiwmic/main.c | 66 ---------------------------------------------- kiwmic/meson.build | 10 ------- meson.build | 1 - 3 files changed, 77 deletions(-) delete mode 100644 kiwmic/main.c delete mode 100644 kiwmic/meson.build diff --git a/kiwmic/main.c b/kiwmic/main.c deleted file mode 100644 index d9a5570..0000000 --- a/kiwmic/main.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (c), Niclas Meyer - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -#include -#include -#include - -#include -#include -#include - -int -main(int argc, char **argv) -{ - if (argc < 2) { - fprintf(stderr, "Not enough arguments\n"); - exit(EXIT_FAILURE); - } - - int sock_fd; - struct sockaddr_un sock_addr; - - memset(&sock_addr, 0, sizeof(sock_addr)); - - const char *sock_path = getenv("KIWMI_SOCKET"); - - if (!sock_path) { - fprintf(stderr, "KIWMI_SOCKET not set\n"); - exit(EXIT_FAILURE); - } - - strncpy(sock_addr.sun_path, sock_path, sizeof(sock_addr.sun_path)); - - sock_addr.sun_family = AF_UNIX; - - if ((sock_fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - fprintf(stderr, "Failed to create socket\n"); - exit(EXIT_FAILURE); - } - - if (connect(sock_fd, (struct sockaddr *)&sock_addr, sizeof(sock_addr)) - < 0) { - fprintf(stderr, "Failed to connect to socket\n"); - exit(EXIT_FAILURE); - } - - FILE *socket_file = fdopen(sock_fd, "r+"); - - for (int i = 1; i < argc; ++i) { - fprintf(socket_file, "%s ", argv[i]); - } - - fprintf(socket_file, "%c", '\0'); - fflush(socket_file); - - int c; - while ((c = getc(socket_file)) != EOF) { - putchar(c); - } - - fclose(socket_file); -} diff --git a/kiwmic/meson.build b/kiwmic/meson.build deleted file mode 100644 index 995cbe4..0000000 --- a/kiwmic/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -kiwmic_sources = files( - 'main.c', -) - -executable( - 'kiwmic', - kiwmic_sources, - include_directories: [include], - install: true, -) diff --git a/meson.build b/meson.build index dee23c4..5c3586d 100644 --- a/meson.build +++ b/meson.build @@ -45,4 +45,3 @@ else endif subdir('kiwmi') -subdir('kiwmic')