Michael McConville wrote on Mon, Jan 04, 2016 at 01:12:56PM -0500:
> Theo Buehler wrote:

>> CVSROOT:     /cvs
>> Module name: src
>> Changes by:  t...@cvs.openbsd.org    2016/01/04 03:59:23
>> 
>> Modified files:
>>      usr.bin/make   : main.c 
>> 
>> Log message:
>> Use err(3) instead of various handrolled combinations of perror(3) and
>> fprintf(stderr, ...) with strerror(3) and exit(3).  Make sure the exit
>> status is 2 if an error occurred.  Prompted by gsoares@'s and jsg@'s
>> audit of exit statuses after failure of pledge(2).
>> 
>> ok gsoares@

> Note that while most err.h functions are in glibc and even musl, they
> aren't standardized. Because of this, a few things in base such as
> LibreSSL and OpenSSH use perror/exit instead. I don't know whether this
> is relevant to make, but I thought it was worth mentioning.

Also note that even if you want to maintain a portable version
of some OpenBSD software, it isn't a bad approach to use good
interfaces anyway and bundle them, to be used only on systems
lacking them.  Mandoc does that, for example.  Here are the
relevant files from the portable version:

  http://mdocml.bsd.lv/cgi-bin/cvsweb/compat_err.c
  http://mdocml.bsd.lv/cgi-bin/cvsweb/test-err.c

They are short, and they are only needed in the portable tree,
not in the OpenBSD tree.

Reply via email to