diff --git a/src/irda.c b/src/irda.c index b0ee69e..57b5076 100644 --- a/src/irda.c +++ b/src/irda.c @@ -83,7 +83,7 @@ irda_socket_open (irda_t **out, dc_context_t *context) #ifdef _WIN32 SYSERROR (context, ERROR_OUTOFMEMORY); #else - SYSERROR (context, errno); + SYSERROR (context, ENOMEM); #endif return -1; // ENOMEM (Not enough space) } diff --git a/src/serial_posix.c b/src/serial_posix.c index ffd4047..b67ddb7 100644 --- a/src/serial_posix.c +++ b/src/serial_posix.c @@ -137,7 +137,7 @@ serial_open (serial_t **out, dc_context_t *context, const char* name) // Allocate memory. serial_t *device = (serial_t *) malloc (sizeof (serial_t)); if (device == NULL) { - SYSERROR (context, errno); + SYSERROR (context, ENOMEM); return -1; // ENOMEM (Not enough space) }