~ius-coredev/ius/openldap24

« back to all changes in this revision

Viewing changes to SOURCES/openldap-invalid-sockets.patch

  • Committer: Jeffrey Ness
  • Date: 2012-08-15 18:21:06 UTC
  • Revision ID: jeffrey.ness@rackspace.com-20120815182106-fifa0yp2oe0u3tsw
first

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
fix: don't close invalid sockets
 
2
 
 
3
From 512c7ca2732118149c3ee4b23980fe03d29077b2 Mon Sep 17 00:00:00 2001
 
4
From: Howard Chu <hyc@openldap.org>
 
5
Date: Wed, 21 Jul 2010 23:41:17 +0000
 
6
Upstream ITS: #6585
 
7
Resolves: #784203
 
8
 
 
9
---
 
10
 libraries/liblber/sockbuf.c |   11 +++++++----
 
11
 1 files changed, 7 insertions(+), 4 deletions(-)
 
12
 
 
13
diff --git a/libraries/liblber/sockbuf.c b/libraries/liblber/sockbuf.c
 
14
index e1d9e45..5bd0a1d 100644
 
15
--- a/libraries/liblber/sockbuf.c
 
16
+++ b/libraries/liblber/sockbuf.c
 
17
@@ -541,7 +541,8 @@ sb_stream_close( Sockbuf_IO_Desc *sbiod )
 
18
 {
 
19
        assert( sbiod != NULL );
 
20
        assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
 
21
-       tcp_close( sbiod->sbiod_sb->sb_fd );
 
22
+       if ( sbiod->sbiod_sb->sb_fd != AC_SOCKET_INVALID )
 
23
+               tcp_close( sbiod->sbiod_sb->sb_fd );
 
24
    return 0;
 
25
 }
 
26
 
 
27
@@ -754,7 +755,8 @@ sb_fd_close( Sockbuf_IO_Desc *sbiod )
 
28
        assert( sbiod != NULL );
 
29
        assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
 
30
 
 
31
-       close( sbiod->sbiod_sb->sb_fd );
 
32
+       if ( sbiod->sbiod_sb->sb_fd != AC_SOCKET_INVALID )
 
33
+               close( sbiod->sbiod_sb->sb_fd );
 
34
        return 0;
 
35
 }
 
36
 
 
37
@@ -956,8 +958,9 @@ sb_dgram_close( Sockbuf_IO_Desc *sbiod )
 
38
 {
 
39
        assert( sbiod != NULL );
 
40
        assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
 
41
-
 
42
-       tcp_close( sbiod->sbiod_sb->sb_fd );
 
43
+  
 
44
+       if ( sbiod->sbiod_sb->sb_fd != AC_SOCKET_INVALID )
 
45
+               tcp_close( sbiod->sbiod_sb->sb_fd );
 
46
        return 0;
 
47
 }
 
48
 
 
49
-- 
 
50
1.7.7.6
 
51