mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 11:30:30 +00:00
2004-11-19 David Young <dyoung@pobox.com>
* log.c: (safe_strerror) New function: safe wrapper for strerror.
This commit is contained in:
parent
ff29bb3150
commit
ca35976927
@ -1,3 +1,7 @@
|
|||||||
|
2004-11-19 David Young <dyoung@pobox.com>
|
||||||
|
|
||||||
|
* log.c: (safe_strerror) New function: safe wrapper for strerror.
|
||||||
|
|
||||||
2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
* sockopt.c: (setsockopt_so_recvbuf) Stop error message from being
|
* sockopt.c: (setsockopt_so_recvbuf) Stop error message from being
|
||||||
|
@ -498,3 +498,11 @@ mes_lookup (struct message *meslist, int max, int index)
|
|||||||
}
|
}
|
||||||
return meslist[index].str;
|
return meslist[index].str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Wrapper around strerror to handle case where it returns NULL. */
|
||||||
|
const char *
|
||||||
|
safe_strerror(int errnum)
|
||||||
|
{
|
||||||
|
const char *s = strerror(errnum);
|
||||||
|
return (s != NULL) ? s : "Unknown error";
|
||||||
|
}
|
||||||
|
@ -126,4 +126,7 @@ const char *mes_lookup (struct message *meslist, int max, int index);
|
|||||||
|
|
||||||
extern const char *zlog_priority[];
|
extern const char *zlog_priority[];
|
||||||
|
|
||||||
|
/* Safe version of strerror -- never returns NULL. */
|
||||||
|
extern const char *safe_strerror(int errnum);
|
||||||
|
|
||||||
#endif /* _ZEBRA_LOG_H */
|
#endif /* _ZEBRA_LOG_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user