There are two things happening in this commit. 1) Move each function
attribute to it's own line 2) move function return value after attributes so
that function inputs and outputs are on same line.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Turned out lsblk is passing null as argument to xstrdup(), so fix that and
add assert() to make sure promise of not returning null is kept in future.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This warning is repeated 112 times when compiling with all warnings.
xalloc.h:23:1: warning: function '__err_oom' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Let the compiler optimize based on the knowledge that the return value will
never be null.
Reference: https://patchwork.ozlabs.org/patch/281112/#631159
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This fixes a segfault in mount (and possibly elsewhere) when invoked
without a -t parameter.
Broken in 7ef9fd7 when the common xalloc.h libs were introduced.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Solaris lacks err, errx, warn and warnx. This also means the err.h header
doesn't exist. Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
xalloc.h needs string.h for declaration of strdup(). Otherwise we
can get implicit declaration warning. This patch prevents it.
Signed-off-by: Marek Polacek <mpolacek@redhat.com>