mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-19 00:18:51 +09:00
![Przemyslaw Marczak](/assets/img/avatar_default.png)
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>
13 lines
212 B
C
13 lines
212 B
C
#ifndef _ERRNO_H
|
|
|
|
#include <asm-generic/errno.h>
|
|
|
|
extern int errno;
|
|
|
|
#define __set_errno(val) do { errno = val; } while (0)
|
|
|
|
#ifdef CONFIG_ERRNO_STR
|
|
const char *errno_str(int errno);
|
|
#endif
|
|
#endif /* _ERRNO_H */
|