[Ltrace-devel] [PATCH] Use err(3) instead of error(3) as more portable function
Petr Machata
pmachata at redhat.com
Mon Oct 1 08:34:42 UTC 2012
Magnus Fromreide <magfr at lysator.liu.se> writes:
> On Sun, 2012-09-30 at 18:56 +0400, Andrey Zonov wrote:
>> On 9/30/12 5:19 PM, Magnus Fromreide wrote:
>> > On Sun, 2012-09-30 at 15:17 +0400, Andrey Zonov wrote:
>> >
>> > err is BSD extensions. error is GNU extensions.
>> >
>>
>> err(3) are in BSD libc and in glibc. error(3) is only in glibc.
>
> Yes. And fprintf + exit is in every libc out there, right?
Technically the proper replacement would be fflush(stdout) + fprintf +
exit, but I don't think we need to care about the flush. But I agree
that once we are touching this code, we should fix it all the way. Most
of ltrace uses fprintf anyway, even in cases where it explicitly needs
to call strerror, which error would abstract away.
Thanks,
PM
More information about the Ltrace-devel
mailing list