X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=libserialport_internal.h;fp=libserialport_internal.h;h=d784472bb12d0c218413d645ff38e3dec8588da3;hb=fa106ef155a8b18e1dc87ccc6d4cf102068fe114;hp=dd69733e9f38a0b3b76764d61890fd7dec3c513f;hpb=bd0fb6094f3b3cf7368bb17b09e30dd3408f9eae;p=libserialport.git diff --git a/libserialport_internal.h b/libserialport_internal.h index dd69733..d784472 100644 --- a/libserialport_internal.h +++ b/libserialport_internal.h @@ -85,6 +85,16 @@ #define TIOCOUTQ FIONWRITE #endif +/* + * O_CLOEXEC is not available everywhere, fallback to not setting the + * flag on those systems. + */ +#ifndef _WIN32 +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif +#endif + /* Non-standard baudrates are not available everywhere. */ #if (defined(HAVE_TERMIOS_SPEED) || defined(HAVE_TERMIOS2_SPEED)) && HAVE_DECL_BOTHER #define USE_TERMIOS_SPEED