1
0
Fork 0
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:
Jonas 'Sortie' Termansen 2015-05-13 20:07:19 +02:00
parent d068a352f7
commit 423fbad835

View file

@ -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. This file is part of the Sortix C Library.
@ -22,11 +22,12 @@
*******************************************************************************/ *******************************************************************************/
#include <errno.h>
#include <error.h>
#include <stdio.h> #include <stdio.h>
extern "C" void perror(const char* s) 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");
} }