slweb

Једноставни генератор статичких веб страна
git clone https://git.sr.ht/~strahinja/slweb
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување ffebc77bebfa9c0a3447cd0ee35cb547e3dda432
родитељ 8954dde367561b2d199528d5cfc69bef6409e95b
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Thu, 22 Feb 2024 18:30:33 +0100

Remove prctl call

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
MTODO | 5+++--
Mdefs.h | 9+--------
Mslweb.c | 11-----------
измењених датотека: 3, додавања: 4(+), брисања: 21(-)

diff --git a/TODO b/TODO @@ -1,9 +1,10 @@ TODO ==== -[~] Critical: There is no sys/prctl.h in OpenBSD? +[x] Critical: There is no sys/prctl.h in OpenBSD? [x] Immediate bandaid solution (missing functionality under OpenBSD) - [ ] Real solution (children die with parent) + [/] Real solution (children die with parent) + - Is there actually any need? [ ] Switch to strlcpy/strlcat diff --git a/defs.h b/defs.h @@ -14,13 +14,6 @@ #include <stdlib.h> #include <stdint.h> #include <string.h> -#ifdef __OpenBSD__ -/* TODO: Add any necessary headers for the equivalent of prctl */ -#elif __linux__ -#include <sys/prctl.h> -#else -#error Unsupported OS! Patches welcome... -#endif #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> @@ -29,7 +22,7 @@ #include "version.h" #include "utf8.h" -#define COPYRIGHTYEAR "2020-2023" +#define COPYRIGHTYEAR "2020-2024" #define MADEBY_URL "https://strahinja.srht.site/slweb/" #define BUFSIZE 1024 diff --git a/slweb.c b/slweb.c @@ -418,12 +418,6 @@ print_command(FILE* output, const char* command, const u8* pass_arguments[], close(arg_pipe_fds[PIPE_WRITE_INDEX]); close(output_pipe_fds[PIPE_READ_INDEX]); -#ifdef __OpenBSD__ -/* TODO: Add the equivalent of prctl... */ -#elif __linux__ - prctl(PR_SET_PDEATHSIG, SIGTERM); -#endif - dup2(arg_pipe_fds[PIPE_READ_INDEX], STDIN_FILENO); dup2(output_pipe_fds[PIPE_WRITE_INDEX], STDOUT_FILENO); @@ -1406,11 +1400,6 @@ process_include(FILE* output, const u8* token, int result = 0; FILE* child_output = NULL; -#ifdef __OpenBSD__ -/* TODO: Add the equivalent of prctl... */ -#elif __linux__ - prctl(PR_SET_PDEATHSIG, SIGTERM); -#endif close(arg_pipe_fds[PIPE_WRITE_INDEX]); close(output_pipe_fds[PIPE_READ_INDEX]); if (!(child_output