Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
579
Issues
579
List
Boards
Labels
Service Desk
Milestones
Merge Requests
109
Merge Requests
109
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
7c3e3429
Commit
7c3e3429
authored
Jul 23, 2019
by
Ondřej Surý
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use isc_refcount_increment0() where appropriate
parent
9ce3254a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
12 deletions
+10
-12
lib/dns/lib.c
lib/dns/lib.c
+1
-1
lib/dns/rbtdb.c
lib/dns/rbtdb.c
+1
-1
lib/isc/unix/socket.c
lib/isc/unix/socket.c
+3
-3
lib/isc/win32/socket.c
lib/isc/win32/socket.c
+2
-2
lib/ns/client.c
lib/ns/client.c
+2
-4
lib/ns/lib.c
lib/ns/lib.c
+1
-1
No files found.
lib/dns/lib.c
View file @
7c3e3429
...
...
@@ -91,7 +91,7 @@ dns_lib_init(void) {
if
(
!
initialize_done
)
return
(
ISC_R_FAILURE
);
isc_refcount_increment
(
&
references
);
isc_refcount_increment
0
(
&
references
);
return
(
ISC_R_SUCCESS
);
}
...
...
lib/dns/rbtdb.c
View file @
7c3e3429
...
...
@@ -1818,7 +1818,7 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
static inline void
new_reference(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) {
INSIST(!ISC_LINK_LINKED(node, deadlink));
if
(
isc_refcount_increment
(
&
node
->
references
)
==
0
)
{
if (isc_refcount_increment
0
(&node->references) == 0) {
/* this is the first reference to the node */
isc_refcount_increment0(&rbtdb->node_locks[node->locknum].references);
}
...
...
lib/isc/unix/socket.c
View file @
7c3e3429
...
...
@@ -2489,7 +2489,7 @@ socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type,
abort
();
}
sock
->
threadid
=
gen_threadid
(
sock
);
isc_refcount_increment
(
&
sock
->
references
);
isc_refcount_increment
0
(
&
sock
->
references
);
thread
=
&
manager
->
threads
[
sock
->
threadid
];
*
socketp
=
(
isc_socket_t
*
)
sock
;
...
...
@@ -3149,7 +3149,7 @@ process_fd(isc__socketthread_t *thread, int fd, bool readable,
return
;
}
if
(
isc_refcount_increment
(
&
sock
->
references
)
==
0
)
{
if
(
isc_refcount_increment
0
(
&
sock
->
references
)
==
0
)
{
/*
* Sock is being closed, it will be destroyed, bail.
*/
...
...
@@ -4678,7 +4678,7 @@ isc_socket_accept(isc_socket_t *sock0,
UNLOCK
(
&
sock
->
lock
);
return
(
ISC_R_SHUTTINGDOWN
);
}
isc_refcount_increment
(
&
nsock
->
references
);
isc_refcount_increment
0
(
&
nsock
->
references
);
nsock
->
statsindex
=
sock
->
statsindex
;
dev
->
ev_sender
=
ntask
;
...
...
lib/isc/win32/socket.c
View file @
7c3e3429
...
...
@@ -1736,7 +1736,7 @@ isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp) {
CONSISTENT
(
sock
);
UNLOCK
(
&
sock
->
lock
);
isc_refcount_increment
(
&
sock
->
references
);
isc_refcount_increment
0
(
&
sock
->
references
);
*
socketp
=
sock
;
}
...
...
@@ -3114,7 +3114,7 @@ isc_socket_accept(isc_socket_t *sock,
UNLOCK
(
&
sock
->
lock
);
return
(
ISC_R_SHUTTINGDOWN
);
}
isc_refcount_increment
(
&
nsock
->
references
);
isc_refcount_increment
0
(
&
nsock
->
references
);
adev
->
ev_sender
=
ntask
;
adev
->
newsocket
=
nsock
;
...
...
lib/ns/client.c
View file @
7c3e3429
...
...
@@ -2347,7 +2347,7 @@ clientmgr_attach(ns_clientmgr_t *source, ns_clientmgr_t **targetp) {
REQUIRE
(
VALID_MANAGER
(
source
));
REQUIRE
(
targetp
!=
NULL
&&
*
targetp
==
NULL
);
oldrefs
=
isc_refcount_increment
(
&
source
->
references
);
oldrefs
=
isc_refcount_increment
0
(
&
source
->
references
);
isc_log_write
(
ns_lctx
,
NS_LOGCATEGORY_CLIENT
,
NS_LOGMODULE_CLIENT
,
ISC_LOG_DEBUG
(
3
),
"clientmgr @%p attach: %d"
,
source
,
oldrefs
+
1
);
...
...
@@ -2478,7 +2478,6 @@ ns_clientmgr_destroy(ns_clientmgr_t **managerp) {
isc_result_t
result
;
ns_clientmgr_t
*
manager
;
bool
unlock
=
false
;
int32_t
oldrefs
;
REQUIRE
(
managerp
!=
NULL
);
manager
=
*
managerp
;
...
...
@@ -2502,8 +2501,7 @@ ns_clientmgr_destroy(ns_clientmgr_t **managerp) {
isc_task_endexclusive
(
manager
->
excl
);
}
oldrefs
=
isc_refcount_decrement
(
&
manager
->
references
);
if
(
oldrefs
==
1
)
{
if
(
isc_refcount_decrement
(
&
manager
->
references
)
==
1
)
{
clientmgr_destroy
(
manager
);
}
...
...
lib/ns/lib.c
View file @
7c3e3429
...
...
@@ -68,7 +68,7 @@ ns_lib_init(void) {
if
(
!
initialize_done
)
return
(
ISC_R_FAILURE
);
isc_refcount_increment
(
&
references
);
isc_refcount_increment
0
(
&
references
);
return
(
ISC_R_SUCCESS
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment