mirror of
https://github.com/owntracks/recorder.git
synced 2026-08-23 11:26:16 +00:00
Add support for OpenBSD
This commit is contained in:
@@ -33,8 +33,12 @@
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
#ifdef WITH_TOURS
|
||||
#ifdef __OpenBSD__
|
||||
# include <uuid.h>
|
||||
#else
|
||||
# include <uuid/uuid.h>
|
||||
#endif
|
||||
#endif
|
||||
#include "udata.h"
|
||||
|
||||
#ifndef LINESIZE
|
||||
@@ -672,10 +676,26 @@ char *uuid4()
|
||||
{
|
||||
static char uustr[37];
|
||||
uuid_t uu;
|
||||
#ifdef __OpenBSD__
|
||||
uint32_t status;
|
||||
char *temp_uustr;
|
||||
|
||||
uuid_create(&uu, &status);
|
||||
if (status != uuid_s_ok) {
|
||||
printf("could not create uuid\n");
|
||||
return (uustr);
|
||||
}
|
||||
|
||||
uuid_to_string(&uu, &temp_uustr, &status);
|
||||
if (status != uuid_s_ok) {
|
||||
printf("could not stringify uuid\n");
|
||||
return (uustr);
|
||||
}
|
||||
strlcpy(uustr, temp_uustr, 37);
|
||||
#else
|
||||
uuid_generate(uu);
|
||||
uuid_unparse_lower(uu, uustr);
|
||||
|
||||
#endif
|
||||
return (uustr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user