aboutsummaryrefslogtreecommitdiff
path: root/apps/systemlib/err.c
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-10-23 23:38:45 -0700
committerpx4dev <px4@purgatory.org>2012-10-23 23:51:13 -0700
commit2fc10320697ecaa9c4e0c52d4d047424e41e6336 (patch)
tree4f18f494ab811e29dc55452f92a63fff9d271dda /apps/systemlib/err.c
parent34f99c7dca1995f8ddd9e8d61c4cbd7289f40e99 (diff)
downloadpx4-firmware-2fc10320697ecaa9c4e0c52d4d047424e41e6336.tar.gz
px4-firmware-2fc10320697ecaa9c4e0c52d4d047424e41e6336.tar.bz2
px4-firmware-2fc10320697ecaa9c4e0c52d4d047424e41e6336.zip
Major formatting/whitespace cleanup
Diffstat (limited to 'apps/systemlib/err.c')
-rw-r--r--apps/systemlib/err.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/systemlib/err.c b/apps/systemlib/err.c
index f22c5ed0d..3011743a1 100644
--- a/apps/systemlib/err.c
+++ b/apps/systemlib/err.c
@@ -79,8 +79,10 @@ warnerr_core(int errcode, const char *fmt, va_list args)
/* convenience as many parts of NuttX use negative errno */
if (errcode < 0)
errcode = -errcode;
+
if (errcode < NOCODE)
fprintf(stderr, ": %s", strerror(errcode));
+
fprintf(stderr, "\n");
#elif CONFIG_ARCH_LOWPUTC
lib_lowprintf("%s: ", getprogname());
@@ -89,8 +91,10 @@ warnerr_core(int errcode, const char *fmt, va_list args)
/* convenience as many parts of NuttX use negative errno */
if (errcode < 0)
errcode = -errcode;
+
if (errcode < NOCODE)
lib_lowprintf(": %s", strerror(errcode));
+
lib_lowprintf("\n");
#endif
}
@@ -144,7 +148,7 @@ verrx(int exitcode, const char *fmt, va_list args)
}
void
-warn(const char *fmt, ...)
+warn(const char *fmt, ...)
{
va_list args;
@@ -153,13 +157,13 @@ warn(const char *fmt, ...)
}
void
-vwarn(const char *fmt, va_list args)
+vwarn(const char *fmt, va_list args)
{
warnerr_core(errno, fmt, args);
}
void
-warnc(int errcode, const char *fmt, ...)
+warnc(int errcode, const char *fmt, ...)
{
va_list args;
@@ -168,13 +172,13 @@ warnc(int errcode, const char *fmt, ...)
}
void
-vwarnc(int errcode, const char *fmt, va_list args)
+vwarnc(int errcode, const char *fmt, va_list args)
{
warnerr_core(errcode, fmt, args);
}
void
-warnx(const char *fmt, ...)
+warnx(const char *fmt, ...)
{
va_list args;
@@ -183,7 +187,7 @@ warnx(const char *fmt, ...)
}
void
-vwarnx(const char *fmt, va_list args)
+vwarnx(const char *fmt, va_list args)
{
warnerr_core(NOCODE, fmt, args);
}