diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index cd012c636..1285b795a 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2002-06-03 Corinna Vinschen + + * fhandler_dsp.cc (fhandler_dev_dsp::open): Set errno to EACCES if + requested mode isn't supported. + 2002-06-03 Christopher Faylor * fhandler.cc (fhandler_base::open): Don't set binmode if already set. diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index 6ea8f3cbd..907eb24e8 100644 --- a/winsup/cygwin/fhandler_dsp.cc +++ b/winsup/cygwin/fhandler_dsp.cc @@ -434,7 +434,10 @@ fhandler_dev_dsp::open (path_conv *, int flags, mode_t mode) { // currently we only support writing if ((flags & (O_WRONLY | O_RDONLY | O_RDWR)) != O_WRONLY) - return 0; + { + set_errno (EACCES); + return 0; + } set_flags (flags);