From 5932088f229176ad50484589866930e52854f9a2 Mon Sep 17 00:00:00 2001 From: "Christopher S. Hull" Date: Fri, 18 Jun 2004 03:44:12 +0000 Subject: [PATCH] have close() call closesocket if _close() returns error git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1425 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/compat/compat.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index 4a954ab50d..c525fdaef8 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -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 -- 2.39.5