summaryrefslogtreecommitdiff
path: root/source4/lib/socket/socket.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-05-17 02:19:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:52:31 -0500
commit59d1a2b30ef3a57536876d2c58c108b6da19e4fa (patch)
tree5a607e88cf190bbc078d6e8d7010e5e77508256e /source4/lib/socket/socket.c
parent87379e0d5877fc0d045e259d8428304a292088aa (diff)
downloadsamba-59d1a2b30ef3a57536876d2c58c108b6da19e4fa.tar.gz
samba-59d1a2b30ef3a57536876d2c58c108b6da19e4fa.tar.bz2
samba-59d1a2b30ef3a57536876d2c58c108b6da19e4fa.zip
r22960: added a SOCKET_FLAG_NOCLOSE to allow us to tell the socket layer that
we will handle the close of the socket (This used to be commit d57aaf5ba60464e5e782353a0879a84f8c70dd32)
Diffstat (limited to 'source4/lib/socket/socket.c')
-rw-r--r--source4/lib/socket/socket.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c
index d975eae2dc..548b11ebcc 100644
--- a/source4/lib/socket/socket.c
+++ b/source4/lib/socket/socket.c
@@ -30,7 +30,8 @@
*/
static int socket_destructor(struct socket_context *sock)
{
- if (sock->ops->fn_close) {
+ if (sock->ops->fn_close &&
+ !(sock->flags & SOCKET_FLAG_NOCLOSE)) {
sock->ops->fn_close(sock);
}
return 0;
@@ -547,3 +548,10 @@ _PUBLIC_ void set_socket_options(int fd, const char *options)
talloc_free(options_list);
}
+/*
+ set some flags on a socket
+ */
+void socket_set_flags(struct socket_context *sock, unsigned flags)
+{
+ sock->flags |= flags;
+}