X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fcoloredstderr.c;h=f005c726446a35231dd6a4ebacce7367e461a27b;hb=488159627f4f579a80b71c5f7713126864d5623f;hp=727c580895b7814d18bba43ec832e905ba7ff6b4;hpb=86352712fdc5fa08777eca1458f4ef6bbe579e7b;p=coloredstderr%2Fcoloredstderr.git diff --git a/src/coloredstderr.c b/src/coloredstderr.c index 727c580..f005c72 100644 --- a/src/coloredstderr.c +++ b/src/coloredstderr.c @@ -121,7 +121,7 @@ static size_t post_string_size; /* Load alternative pre/post strings from the environment if available, fall * back to default values. */ -inline static void init_pre_post_string(void) { +static void init_pre_post_string(void) { pre_string = getenv(ENV_NAME_PRE_STRING); if (!pre_string) { pre_string = DEFAULT_PRE_STRING; @@ -135,6 +135,13 @@ inline static void init_pre_post_string(void) { post_string_size = strlen(post_string); } +/* Don't inline any of the pre/post functions. Keep the hook function as small + * as possible for speed reasons. */ +static void handle_fd_pre(int fd) __noinline; +static void handle_fd_post(int fd) __noinline; +static void handle_file_pre(FILE *stream) __noinline; +static void handle_file_post(FILE *stream) __noinline; + static void handle_fd_pre(int fd) { int saved_errno = errno;