Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ int copy_file(const char* in, const char* out)
XFCLOSE(outFile);
return ret;
}

#if defined(__MACH__) || defined(__FreeBSD__)
int link_file(const char* in, const char* out)
{
return link(in, out);
}
#endif
#endif /* !NO_FILESYSTEM */

#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) && !defined(NO_RSA) && \
Expand Down
4 changes: 2 additions & 2 deletions testsuite/testsuite.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static int test_crl_monitor(void)
if (i % 2 == 0) {
/* succeed on even rounds */
sprintf(buf, "%s/%s", tmpDir, "crl.pem");
if (copy_file("certs/crl/crl.pem", buf) != 0) {
if (STAGE_FILE("certs/crl/crl.pem", buf) != 0) {
fprintf(stderr, "[%d] Failed to copy file to %s\n", i, buf);
goto cleanup;
}
Expand All @@ -350,7 +350,7 @@ static int test_crl_monitor(void)
else {
/* fail on odd rounds */
sprintf(buf, "%s/%s", tmpDir, "crl.revoked");
if (copy_file("certs/crl/crl.revoked", buf) != 0) {
if (STAGE_FILE("certs/crl/crl.revoked", buf) != 0) {
fprintf(stderr, "[%d] Failed to copy file to %s\n", i, buf);
goto cleanup;
}
Expand Down
7 changes: 7 additions & 0 deletions wolfssl/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,13 @@ int rem_dir(const char* dirName);
int rem_file(const char* fileName);
int copy_file(const char* in, const char* out);

#if defined(__MACH__) || defined(__FreeBSD__)
int link_file(const char* in, const char* out);
#define STAGE_FILE(x,y) link_file((x),(y))
#else
#define STAGE_FILE(x,y) copy_file((x),(y))
#endif

void signal_ready(tcp_ready* ready);

/* wolfSSL */
Expand Down