mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix perror(3) compliance.
This commit is contained in:
parent
d068a352f7
commit
423fbad835
1 changed files with 5 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2015.
|
||||
|
||||
This file is part of the Sortix C Library.
|
||||
|
||||
|
@ -22,11 +22,12 @@
|
|||
|
||||
*******************************************************************************/
|
||||
|
||||
#include <errno.h>
|
||||
#include <error.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" void perror(const char* s)
|
||||
{
|
||||
error(0, errno, "%s", s);
|
||||
if ( s && s[0] )
|
||||
fprintf(stderr, "%s: %m\n", s);
|
||||
else
|
||||
fprintf(stderr, "%m\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue