From: Christopher S. Hull Date: Fri, 18 Jun 2004 03:44:12 +0000 (+0000) Subject: have close() call closesocket if _close() returns error X-Git-Tag: Release-1.35.1~104 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5932088f229176ad50484589866930e52854f9a2;p=bacula%2Fbacula 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 --- 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