X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=gnulib%2Fwrite.c;h=3a98f24f94ea0e7cae3db92c0f1b3d3c87c13388;hb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;hp=250b5cc8fd4b30ee6f874d487127612a1d2fc801;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e;p=debian%2Famanda diff --git a/gnulib/write.c b/gnulib/write.c index 250b5cc..3a98f24 100644 --- a/gnulib/write.c +++ b/gnulib/write.c @@ -1,5 +1,5 @@ /* POSIX compatible write() function. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-2010 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -46,14 +46,14 @@ rpl_write (int fd, const void *buf, size_t count) if (ret < 0) { if (GetLastError () == ERROR_NO_DATA - && GetFileType (_get_osfhandle (fd)) == FILE_TYPE_PIPE) - { - /* Try to raise signal SIGPIPE. */ - raise (SIGPIPE); - /* If it is currently blocked or ignored, change errno from EINVAL - to EPIPE. */ - errno = EPIPE; - } + && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE) + { + /* Try to raise signal SIGPIPE. */ + raise (SIGPIPE); + /* If it is currently blocked or ignored, change errno from EINVAL + to EPIPE. */ + errno = EPIPE; + } } return ret; }