FreeRDP
Loading...
Searching...
No Matches
atexit.c
1
21
#include <stdlib.h>
22
#include <errno.h>
23
24
#include <winpr/debug.h>
25
#include <winpr/atexit.h>
26
#include "../log.h"
27
28
#define TAG WINPR_TAG("atexit")
29
30
static
size_t
atexit_count = 0;
31
32
BOOL winpr_atexit(
void
(*fkt)(
void
))
33
{
34
atexit_count++;
35
const
int
rc = atexit(fkt);
36
if
(rc != 0)
37
{
38
char
buffer[128] = WINPR_C_ARRAY_INIT;
39
WLog_ERR(TAG,
"atexit[%"
PRIuz
"] failed: %s [%d]"
, atexit_count,
40
winpr_strerror(errno, buffer,
sizeof
(buffer)), errno);
41
return
FALSE;
42
}
43
return
TRUE;
44
}
winpr
libwinpr
utils
atexit.c
Generated by
1.9.8