diff --git a/contrib/ofed/libsdp/src/port.c b/contrib/ofed/libsdp/src/port.c index 26bcf7cf30e3..ff428394ab33 100644 --- a/contrib/ofed/libsdp/src/port.c +++ b/contrib/ofed/libsdp/src/port.c @@ -40,6 +40,9 @@ #define FASYNC 0 #include #endif +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -217,7 +220,7 @@ volatile static int init_status = 0; /* 0: idle, 1:during, 2:ready */ /* glibc provides these symbols - for Solaris builds we fake them * until _init is called, at which point we quiz libdl.. */ -#ifdef SOLARIS_BUILD +#if defined(SOLARIS_BUILD) || defined(__FreeBSD__) char *program_invocation_name = "[progname]", *program_invocation_short_name = "[short_progname]"; #else @@ -2583,6 +2586,10 @@ void __sdp_init(void) program_invocation_short_name = basename(args_info.dla_argv[0]); } #endif +#ifdef __FreeBSD__ + program_invocation_short_name = (char *)getprogname(); + program_invocation_name = program_invocation_short_name; +#endif if (getenv("SIMPLE_LIBSDP") != NULL) { simple_sdp_library = 1;