Surely the errno to set should depend on *why* SetVariablePrefix() failed.  Did it fail because we ran out of memory ? ENOMEM.  Because some rule forbade it to do so ?  EPERM.  Because it didn't like the value being offered for the prefix ?  EINVAL.  etc.  I suggest that SetVariablePrefix should set errno for itself, when failing, rather than leaving us to do so.