File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 30
30
extern "C" {
31
31
#endif
32
32
33
+ /* The setenv() function returns zero on success, or -1 on error, with
34
+ * errno set to indicate the cause of the error.
35
+ *
36
+ * SetEnvironmentVariableA Return value
37
+ * If the function succeeds, the return value is nonzero.
38
+ * If the function fails, the return value is zero.
39
+ */
33
40
inline int setenv (const char * varname , const char * value_string , int overwrite )
34
41
{
35
- return SetEnvironmentVariableA (varname , value_string );
42
+ return SetEnvironmentVariableA (varname , value_string ) ? 0 : -1 ;
36
43
}
37
44
45
+ /* The unsetenv() function returns zero on success, or -1 on error,
46
+ * with errno set to indicate the cause of the error.
47
+ * SetEnvironmentVariableA Return value
48
+ * If the function succeeds, the return value is nonzero.
49
+ * If the function fails, the return value is zero.
50
+ */
38
51
inline int unsetenv (const char * varname )
39
52
{
40
- return SetEnvironmentVariableA (varname , NULL );
53
+ return SetEnvironmentVariableA (varname , NULL ) ? 0 : -1 ;
41
54
}
42
55
43
56
#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments