From 648ce5c4ccc31a77cff0c55c81f236c0fbedb152 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 15 Oct 2022 11:45:23 -0400 Subject: [PATCH] Remove NonPosix.h; it seems to be causing more trouble than it's worth. --- src/HttpServer.c | 2 -- src/Log.c | 1 - src/Telodendria.c | 2 -- src/include/NonPosix.h | 66 ------------------------------------------ tools/bin/td | 2 +- 5 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 src/include/NonPosix.h diff --git a/src/HttpServer.c b/src/HttpServer.c index a81e638..f05f5af 100644 --- a/src/HttpServer.c +++ b/src/HttpServer.c @@ -21,8 +21,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include - #include #include #include diff --git a/src/Log.c b/src/Log.c index f7c6107..7b62d28 100644 --- a/src/Log.c +++ b/src/Log.c @@ -23,7 +23,6 @@ */ #include -#include #include #include diff --git a/src/Telodendria.c b/src/Telodendria.c index 44a7f80..1b87648 100644 --- a/src/Telodendria.c +++ b/src/Telodendria.c @@ -21,8 +21,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include - #include #include #include diff --git a/src/include/NonPosix.h b/src/include/NonPosix.h deleted file mode 100644 index 3949b80..0000000 --- a/src/include/NonPosix.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2022 Jordan Bancino <@jordan:bancino.net> - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * NonPosix.h: A collection of functions that I know certain operating - * systems have, but they aren't specified in POSIX. I'd like to keep - * this header really small if at all possible. - */ -#ifndef TELODENDRIA_NONPOSIX_H -#define TELODENDRIA_NONPOSIX_H - -#include - -/* - * Pretty much all Unix-like systems have a chroot() function. In fact, - * chroot() used to be POSIX, so any operating system claiming to be - * POSIX-like had to have a chroot(). But unfortunately chroot() is not - * in the standard anymore. Luckily, I don't know of a single operating - * system to get rid of chroot(). So we should be able to safely depend - * on a chroot() syscall being available. - */ -extern int chroot(const char *); - -/* - * Pretty much every syslog interface has a vsyslog(). Unfortuntately, - * it is not POSIX. - */ -extern void vsyslog(int, const char *, va_list); - -/* - * Telodendria is primarily developed on OpenBSD; as such, you can - * expect that it will use some OpenBSD-specific features if OpenBSD - * is the target platform. - * - * It is my goal though, to make these functions entirely optional. - * I've wrapped them in a preprocessor guard, and anywhere they're used - * should also be wrapped in the same guard. So if the target platform - * is not OpenBSD, then these aren't used at all. - */ -#ifdef __OpenBSD__ -extern int pledge(const char *, const char *); -extern int unveil(const char *, const char *); -#endif - -#endif diff --git a/tools/bin/td b/tools/bin/td index f1f48b6..0956a5e 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -22,7 +22,7 @@ : "${TELODENDRIA_VERSION:=0.0.0}" : "${CVS_TAG:=Telodendria-$(echo $TELODENDRIA_VERSION | sed 's/\./_/g')}" -: "${DEFINES:=-D_POSIX_C_SOURCE=200809L -DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"}" +: "${DEFINES:=-DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"}" : "${INCLUDES:=-Isrc/include}" : "${CC:=cc}"