Le Tue, Jul 04, 2006 at 06:02:39PM -0300, Andrés ecrivait :
What should be done in an application which expects a return code of
unsetenv (which is void)?

Well, according to SUSv3, unsetenv() returns int. So maybe OpenBSD's libc should follow conform to that.

static gboolean xunsetenv(char *varname)
{
    if (unsetenv(varname) != 0) {
         console_message(_("unsetenv failed!"));
         return TRUE;
    }
    return FALSE;
}

 As OpenBSD and OSX (at least) still return void, maybe the easiest way to
solve that is just to ignore the return value.

 In your port, maybe you can just emulate the return value:
static gboolean xunsetenv(char *varname)
{
 unsetenv(varname);
 return getenv(varname) == NULL ? TRUE : FALSE;
}

 Best regards,

--
Frank Denis - frank [at] nailbox.fr - Young Nails / Akzentz nail tech
http://forum.manucure.info - http://www.manucure-pro.com

Reply via email to