--- uae/src/serial.c 2018/04/24 16:39:50 1.1.1.3 +++ uae/src/serial.c 2018/04/24 17:01:45 1.1.1.6 @@ -16,7 +16,6 @@ #include "uae.h" #include "memory.h" #include "custom.h" -#include "readcpu.h" #include "newcpu.h" #include "cia.h" @@ -360,8 +359,8 @@ void serial_open(void) if (serdev == 1) return; - if ((sd = open (sername, O_RDWR|O_NONBLOCK|O_BINARY, 0)) < 0) { - fprintf (stdout, "Error: Could not open Device %s\n", sername); + if ((sd = open (currprefs.sername, O_RDWR|O_NONBLOCK|O_BINARY, 0)) < 0) { + fprintf (stdout, "Error: Could not open Device %s\n", currprefs.sername); return; } @@ -389,8 +388,8 @@ void serial_open(void) void serial_close (void) { - if (sd != 0) - close(sd); + if (sd >= 0) + close (sd); serdev = 0; }