commit eccd9c6a8de3a6a955143f514cfe8172c0bc89a4 from: Omar Polo date: Thu Jul 22 13:08:13 2021 UTC fix setprogname compat commit - 8563e129ee477efc5618710af6360209e7b67038 commit + eccd9c6a8de3a6a955143f514cfe8172c0bc89a4 blob - 0ee7185b60aaf71dee305cd764f52643acccd3a1 blob + ddfd2925e5893cc1e9112bbe443911c66a82e3b1 --- compat/setprogname.c +++ compat/setprogname.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Nicholas Marriott + * Copyright (c) 2021 Omar Polo * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,39 +16,8 @@ #include "../compat.h" -#include - -#include -#include -#include - -#if HAVE_PR_SET_NAME - -#include - void -setproctitle(const char *fmt, ...) +setprogname(const char *name) { - char title[16], name[16], *cp; - va_list ap; - int used; - - va_start(ap, fmt); - vsnprintf(title, sizeof title, fmt, ap); - va_end(ap); - - used = snprintf(name, sizeof name, "%s: %s", getprogname(), title); - if (used >= (int)sizeof name) { - cp = strrchr(name, ' '); - if (cp != NULL) - *cp = '\0'; - } - prctl(PR_SET_NAME, name); + return; } -#else -void -setproctitle(const char *fmt, ...) -{ - (void)fmt; -} -#endif