Commit Graph

8 Commits

Author SHA1 Message Date
Érico Nogueira
67eddacfc9 c: print strerror() instead of error code.
This changes error() behavior to match what glibc already does.
2021-06-16 20:01:46 +10:00
Michael Forney
007c438148 Also emulate error_at_line if not present 2014-08-28 13:54:24 +02:00
Rainer Müller
838e5d8941 configure: Check for error.h
For portability, check for error.h during configure and define
HAVE_ERROR_H accordingly.

If this header is not available, emulate the functionality of error()
from glibc with an inline wrapper in include/c.h.
2013-03-20 16:32:06 +01:00
Sami Kerola
5d04a5a75c c.h: fix macro definition warning
../include/c.h:106:18: warning: ISO C does not permit named variadic macros [-Wvariadic-macros]
../include/c.h:107:19: warning: ISO C does not permit named variadic macros [-Wvariadic-macros]
../include/c.h:108:25: warning: ISO C does not permit named variadic macros [-Wvariadic-macros]
../include/c.h:109:26: warning: ISO C does not permit named variadic macros [-Wvariadic-macros]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-03 18:32:40 +11:00
Mike Frysinger
af61809a18 include error.h for error() and friends
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-24 08:55:05 +01:00
Craig Small
fb11e1fe0a Changed the err and warns to macros
err and warn are BSD format but they are not recommended by library
developers.  However their consiseness is useful!

The solution is to use some macros that create xerr etc which then
just map to the error() function.  The next problem is error() uses
program_invocation_name so we set this to program_invovation_short_name

This is a global set but seems to be the convention (or at least errors
are on the short name only) used everywhere else.
2012-01-03 18:48:43 +11:00
Sami Kerola
7b6084451d other: tell what was taken from util-linux package
Reference: http://www.freelists.org/post/procps/backporting,1
Reported-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
43318fd0c2 build-sys: add c.h with fundamental C definitions
This file contains various preprocessor directed definitions, and
other definitions, which most programs need.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:17:03 +01:00