Repo-Init
 
Loading...
Searching...
No Matches
ErrorHelpers.hpp File Reference
#include <array>
#include <atomic>
#include <cstring>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for ErrorHelpers.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * checkError (int, char *buffer, int)
 
char * checkError (char *result, const char *, int)
 
std::string getErrnoString (int errVal)
 

Variables

std::vector< std::pair< std::string, std::shared_ptr< std::atomic_flag > > > vCheckFlag
 Global variable to check if the servers are running.
 

Function Documentation

◆ checkError() [1/2]

char * checkError ( char * result,
const char * ,
int  )

Definition at line 8 of file ErrorHelpers.cpp.

8{ return result; }

◆ checkError() [2/2]

char * checkError ( int ,
char * buffer,
int  )

Definition at line 6 of file ErrorHelpers.cpp.

6{ return buffer; }
Here is the caller graph for this function:

◆ getErrnoString()

std::string getErrnoString ( int errVal)
inline

Converts errno to a readable string

Parameters
[in]errValerrno value
Returns
std::string Error message

Definition at line 24 of file ErrorHelpers.hpp.

25{
26 std::array<char, BUFSIZ> buffer{};
27 return checkError(strerror_r(errVal, buffer.data(), BUFSIZ), buffer.data(), errVal);
28}
char * checkError(int, char *buffer, int)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ vCheckFlag

std::vector<std::pair<std::string, std::shared_ptr<std::atomic_flag> > > vCheckFlag
extern

Global variable to check if the servers are running.

Definition at line 4 of file ErrorHelpers.cpp.