diff --git a/src/gurt/misc.c b/src/gurt/misc.c index 55e21f05f4c..fb5d61968ed 100644 --- a/src/gurt/misc.c +++ b/src/gurt/misc.c @@ -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 * diff --git a/src/include/gurt/common.h b/src/include/gurt/common.h index 46c2563accb..41a8d497a67 100644 --- a/src/include/gurt/common.h +++ b/src/include/gurt/common.h @@ -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); @@ -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