Commit ef377655 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Merge verrno into vas, it's too trivial.

parent e6be754f
...@@ -65,7 +65,6 @@ nobase_pkginclude_HEADERS += \ ...@@ -65,7 +65,6 @@ nobase_pkginclude_HEADERS += \
vbm.h \ vbm.h \
vcl.h \ vcl.h \
vcs.h \ vcs.h \
verrno.h \
vmod_abi.h \ vmod_abi.h \
vqueue.h \ vqueue.h \
vre.h \ vre.h \
......
...@@ -40,7 +40,10 @@ ...@@ -40,7 +40,10 @@
#ifndef VAS_H_INCLUDED #ifndef VAS_H_INCLUDED
#define VAS_H_INCLUDED #define VAS_H_INCLUDED
#include "verrno.h"
#include <errno.h>
const char * vstrerror(int e);
enum vas_e { enum vas_e {
VAS_WRONG, VAS_WRONG,
......
/*-
* Written by Nils Goroll based upon a draft by Poul-Henning Kamp
*
* This file is in the public domain.
*
* trivial strerror() wrapper never returning NULL
*/
#include <errno.h>
const char * vstrerror(int e);
...@@ -22,7 +22,6 @@ libvarnish_la_SOURCES = \ ...@@ -22,7 +22,6 @@ libvarnish_la_SOURCES = \
vcli_serve.c \ vcli_serve.c \
vct.c \ vct.c \
venc.c \ venc.c \
verrno.c \
version.c \ version.c \
vev.c \ vev.c \
vfil.c \ vfil.c \
......
...@@ -41,6 +41,20 @@ ...@@ -41,6 +41,20 @@
#include "vas.h" #include "vas.h"
const char *
vstrerror(int e)
{
const char *p;
int oerrno = errno;
p = strerror(e);
if (p != NULL)
return (p);
errno = oerrno;
return ("strerror(3) returned NULL");
}
vas_f *VAS_Fail_Func v_noreturn_; vas_f *VAS_Fail_Func v_noreturn_;
void v_noreturn_ void v_noreturn_
......
/*-
* Written by Nils Goroll based upon a draft by Poul-Henning Kamp
*
* This file is in the public domain.
*
* trivial strerror() wrapper never returning NULL
*/
#include "config.h"
#include <string.h>
#include "verrno.h"
const char *
vstrerror(int e)
{
const char *p;
int oerrno = errno;
p = strerror(e);
if (p != NULL)
return (p);
errno = oerrno;
return ("strerror(3) returned NULL");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment