diff options
Diffstat (limited to 'mysys/my_write.c')
-rw-r--r-- | mysys/my_write.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mysys/my_write.c b/mysys/my_write.c index 64f7546620f..46b0d749944 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -36,6 +36,11 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags) for (;;) { #ifdef _WIN32 + if(Filedes < 0) + { + my_errno= errno= EBADF; + DBUG_RETURN((size_t)-1); + } writtenbytes= my_win_write(Filedes, Buffer, Count); #else writtenbytes= write(Filedes, Buffer, Count); |