Try to give a helpful message in case the program is not initializing
the setproctitle() machinery.
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
+#include <err.h>
#include <unistd.h>
#include <string.h>
/* Pointer to original nul character within base. */
char *nul;
+ bool warned;
bool reset;
int error;
} SPT;
char *nul;
int len;
- if (SPT.base == NULL)
+ if (SPT.base == NULL) {
+ if (!SPT.warned) {
+ warnx("setproctitle not initialized, please either call "
+ "setproctitle_init() or link against libbsd-ctor.");
+ SPT.warned = true;
+ }
return;
+ }
if (fmt) {
if (fmt[0] == '-') {