Skip to content

Commit

Permalink
main: Forgot to define init_name
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Sep 4, 2024
1 parent bfbba38 commit f4bbd37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
#include <string.h>
#include <sys/stat.h>

static char const* init_name = "flamingo";

static void usage(void) {
#if defined(__FreeBSD__)
char const* const progname = getprogname();
#elif defined(__Linux__)
#elif defined(__linux__)
char progname[16] = init_name;

if (prctl(PR_GET_NAME, progname, NULL, NULL, NULL) < 0) {
Expand All @@ -35,6 +37,8 @@ static int call_cb(flamingo_t* flamingo, char* name, void* data) {
}

int main(int argc, char* argv[]) {
init_name = *argv;

// parse arguments

if (argc != 2) {
Expand Down

0 comments on commit f4bbd37

Please sign in to comment.