]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
lib: errno: introduce errno_str(): returns errno related message
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 8 Oct 2014 20:48:37 +0000 (22:48 +0200)
committerSimon Glass <sjg@chromium.org>
Thu, 11 Dec 2014 20:18:41 +0000 (13:18 -0700)
commit59345b1f0f9941d32b45d0e27401355b34106357
treecf1af3b0281bf8962f503bfebca60b3e6fddbe4d
parent115066666c251c2a481eeff7b700da14eba91d10
lib: errno: introduce errno_str(): returns errno related message

The functions error's numbers are standarized - but the error
messages are not.

The errors are often handled with unclear error messages,
so why not use an errno standarized messages.

Advantages:
- This could decrease the binary size.
- Appended with a detailed information,
  the error message will be clear.

This commit introduces new function:
- const char *errno_to_str(int errno)

The functions returns a pointer to the errno corresponding text message:
- if errno is null or positive number - a pointer to "Success" message
- if errno is negative - a pointer to errno related message

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Reviewed-by: Tom Rini <trini@ti.com>
include/errno.h
lib/Makefile
lib/errno_str.c [new file with mode: 0644]