OSDN Git Service

* config/io/basic_file_stdio.cc (__basic_file::_M_open_mode):
authordannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Dec 2002 02:48:19 +0000 (02:48 +0000)
committerdannysmith <dannysmith@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 Dec 2002 02:48:19 +0000 (02:48 +0000)
Don't use O_NONBLOCK if it is not defined.
(__basic_file::open): Don't use fcntl either.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60461 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/config/io/basic_file_stdio.cc

index 3cb1684..d9e1031 100644 (file)
@@ -1,3 +1,9 @@
+2002-12-23  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * config/io/basic_file_stdio.cc (__basic_file::_M_open_mode):
+       Don't use O_NONBLOCK if it is not defined.
+       (__basic_file::open): Don't use fcntl either.
+
 2002-12-20  Sylvain Pion   <Sylvain.Pion@mpi-sb.mpg.de>
 
        * include/bits/stl_deque.h: Fix typo.
index ff23d98..e378b66 100644 (file)
@@ -74,7 +74,11 @@ namespace std
     if (__testi && !__testo && !__testt && !__testa)
       {
        strcpy(__c_mode, "r");
+#if defined (O_NONBLOCK)
        __p_mode |=  O_RDONLY | O_NONBLOCK;
+#else
+       __p_mode |=  O_RDONLY;
+#endif
       }
     if (__testi && __testo && !__testt && !__testa)
       {
@@ -151,9 +155,11 @@ namespace std
          {
            _M_cfile_created = true;
 
+#if defined (F_SETFL) && defined (O_NONBLOCK)
            // Set input to nonblocking for fifos.
            if (__mode & ios_base::in)
              fcntl(this->fd(), F_SETFL, O_NONBLOCK);
+#endif
 
            __ret = this;
          }