In fact, I see SetVariablePrefix(), when failing, calls GetErrorStr(), so it presumes that SendTransaction() has set errno suitably: so why not just leave errno alone here, maybe assert(errno != 0), and trust that SendTransaction() set it sensibly.