]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/fileutl.cc
Upgraded to eg++ 1.1 and libstdc++2.9
[apt.git] / apt-pkg / contrib / fileutl.cc
index cc0363da5f3a7cb236477f148473bedd66e409ca..bfc674c62a58b0c2ca01355d7cb75d1cd834c38b 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: fileutl.cc,v 1.9 1998/10/20 02:39:28 jgg Exp $
+// $Id: fileutl.cc,v 1.10 1998/10/20 04:33:16 jgg Exp $
 /* ######################################################################
    
    File Utilities
@@ -137,7 +137,7 @@ void SetCloseExec(int Fd,bool Close)
 void SetNonBlock(int Fd,bool Block)
 {   
    int Flags = fcntl(Fd,F_GETFL);
-   if (fcntl(Fd,F_SETFL,(Block == false)?0:O_NONBLOCK) != 0)
+   if (fcntl(Fd,F_SETFL,(Flags  & ~O_NONBLOCK) | (Block == false)?0:O_NONBLOCK) != 0)
    {
       cerr << "FATAL -> Could not set non-blocking flag " << strerror(errno) << endl;
       exit(100);