From 577b1c27f5baab911609412a5dc15a95b92504d9 Mon Sep 17 00:00:00 2001 From: Michael Farrell Date: Mon, 9 Jul 2018 15:49:03 +0800 Subject: [PATCH] Allow disabling unlink() with -DNO_UNLINK. (#625) --- client/comms.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/comms.c b/client/comms.c index be0cfd10..2030f8f3 100644 --- a/client/comms.c +++ b/client/comms.c @@ -12,7 +12,7 @@ #include "comms.h" #include -#ifdef __linux__ +#if defined(__linux__) && !defined(NO_UNLINK) #include // for unlink() #endif #include "uart.h" @@ -339,8 +339,10 @@ void CloseProxmark(void) { uart_close(sp); } -#ifdef __linux__ +#if defined(__linux__) && !defined(NO_UNLINK) // Fix for linux, it seems that it is extremely slow to release the serial port file descriptor /dev/* + // + // This may be disabled at compile-time with -DNO_UNLINK (used for a JNI-based serial port on Android). if (serial_port_name) { unlink(serial_port_name); } -- 2.39.5