Skip to content

Commit

Permalink
DAOS-14981 gurt: restore d_getenv_int undefined symbol (#13622)
Browse files Browse the repository at this point in the history
* DAOS-14981 gurt: restore d_getenv_int undefined symbol

Restore missing plain function d_getenv_int() to fix missing symbol with
libdaos.

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@intel.com>
  • Loading branch information
knard-intel authored and jolivier23 committed Feb 28, 2024
1 parent 07c8570 commit b4f9f8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
15 changes: 15 additions & 0 deletions src/gurt/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,21 @@ d_getenv_uint(const char *name, unsigned *uint_val)
return -DER_SUCCESS;
}

/**
* get an unsigned integer type environment variables.
*
* \param[in] name name of the environment variable.
* \param[in,out] uint_val returned value of the ENV. Will not change the original
* value if ENV is not set or set as a non-integer value.
* \return 0 on success, a negative value on error.
* \deprecated d_getenv_int() is deprecated, please use d_getenv_uint().
*/
int
d_getenv_int(const char *name, unsigned *uint_val)
{
return d_getenv_uint(name, uint_val);
}

/**
* get a 32bits unsigned integer type environment variables
*
Expand Down
10 changes: 3 additions & 7 deletions src/include/gurt/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@ d_getenv_bool(const char *name, bool *bool_val);
int
d_getenv_char(const char *name, char *char_val);
int
d_getenv_int(const char *name, unsigned int *uint_val)
__attribute__((deprecated("use d_getenv_uint")));
int
d_getenv_uint(const char *name, unsigned int *uint_val);
int
d_getenv_uint32_t(const char *name, uint32_t *uint32_val);
Expand All @@ -522,13 +525,6 @@ d_unsetenv(const char *name);
int
d_clearenv(void);

static inline int
d_getenv_int(const char *name, unsigned int *uint_val)
{
D_WARN("d_getenv_int() is deprecated, please use d_getenv_uint()");
return d_getenv_uint(name, uint_val);
}

int
d_write_string_buffer(struct d_string_buffer_t *buf, const char *fmt, ...);
void
Expand Down

0 comments on commit b4f9f8d

Please sign in to comment.