"Daniel P. Berrange" wrote:
> On Tue, Jan 27, 2009 at 11:28:32AM +0100, Jim Meyering wrote:
>> "Daniel P. Berrange" wrote:
>> ...
>> > Looking at the whole method again, I think it needs to be re-written to
>> > something closer to this:
>>
>> Ok, I've adapted that.
>> +void virReportSystemErrorF
On Tue, Jan 27, 2009 at 11:28:32AM +0100, Jim Meyering wrote:
> "Daniel P. Berrange" wrote:
> ...
> > Looking at the whole method again, I think it needs to be re-written to
> > something closer to this:
>
> Ok, I've adapted that.
> +void virReportSystemErrorFull(virConnectPtr conn,
> +
"Daniel P. Berrange" wrote:
...
> Looking at the whole method again, I think it needs to be re-written to
> something closer to this:
Ok, I've adapted that.
Changes:
- handle snprintf and vsnprintf failure
- insert ": " into the result string
- use stpcpy, not strcat (as a general waste-avo
On Mon, Jan 26, 2009 at 03:02:48PM +0100, Jim Meyering wrote:
>
> So, since we'd rather avoid having to allocate at all in the
> error-reporting path (esp for OOM errors), I've made it automatic.
That doesn't really matter/help the OOM reporting scenario, because
the convention for VIR_ERR_NO_MEM
While looking at removing most of the remaining uses of strerror,
I spotted problems in virReportSystemErrorFull.
1) it would leak "combined"
2) that allocated, written-into buffer wasn't even used
So, since we'd rather avoid having to allocate at all in the
error-reporting path (esp for OOM e