]> git.sur5r.net Git - bacula/bacula/commitdiff
have close() call closesocket if _close() returns error
authorChristopher S. Hull <csh@raidersolutions.com>
Fri, 18 Jun 2004 03:44:12 +0000 (03:44 +0000)
committerChristopher S. Hull <csh@raidersolutions.com>
Fri, 18 Jun 2004 03:44:12 +0000 (03:44 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1425 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/win32/compat/compat.cpp

index 4a954ab50dfdc301f0182a7284661794c5d8b4ac..c525fdaef8b711d2a1e53ac214c042408de12710 100644 (file)
@@ -17,7 +17,7 @@
 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 //   General Public License for more details.
 //
-//   You should have received a copy of the GNU General Public
+//   You should have received a copcloy of the GNU General Public
 //   License along with this program; if not, write to the Free
 //   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 //   MA 02111-1307, USA.
@@ -1162,7 +1162,10 @@ open(const char *file, int flags, int mode)
 int
 close(int fd)
 {
-    return _close(fd);
+    int rval = _close(fd);
+    if (rval == -1)
+       rval = closesocket(fd);
+    return rval;
 }
 
 #ifndef HAVE_WXCONSOLE