Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jarl
tor
Commits
2d3f88f6
Commit
2d3f88f6
authored
9 years ago
by
cypherpunks
Committed by
Nick Mathewson
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove casting of void pointers when handling signals.
parent
f4b03f93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/or/main.c
+7
-5
7 additions, 5 deletions
src/or/main.c
src/or/main.h
+1
-1
1 addition, 1 deletion
src/or/main.h
with
8 additions
and
6 deletions
src/or/main.c
+
7
−
5
View file @
2d3f88f6
...
...
@@ -2227,7 +2227,8 @@ run_main_loop_until_done(void)
static
void
signal_callback
(
int
fd
,
short
events
,
void
*
arg
)
{
uintptr_t
sig
=
(
uintptr_t
)
arg
;
const
int
*
sigptr
=
arg
;
const
int
sig
=
*
sigptr
;
(
void
)
fd
;
(
void
)
events
;
...
...
@@ -2237,7 +2238,7 @@ signal_callback(int fd, short events, void *arg)
/** Do the work of acting on a signal received in <b>sig</b> */
void
process_signal
(
u
int
ptr_t
sig
)
process_signal
(
int
sig
)
{
switch
(
sig
)
{
...
...
@@ -2482,9 +2483,10 @@ handle_signals(int is_parent)
static
struct
event
*
signal_events
[
16
];
/* bigger than it has to be. */
if
(
is_parent
)
{
for
(
i
=
0
;
signals
[
i
]
>=
0
;
++
i
)
{
signal_events
[
i
]
=
tor_evsignal_new
(
tor_libevent_get_base
(),
signals
[
i
],
signal_callback
,
(
void
*
)(
uintptr_t
)
signals
[
i
]);
signal_events
[
i
]
=
tor_evsignal_new
(
tor_libevent_get_base
(),
signals
[
i
],
signal_callback
,
/* Cast away const */
(
int
*
)
&
signals
[
i
]);
if
(
event_add
(
signal_events
[
i
],
NULL
))
log_warn
(
LD_BUG
,
"Error from libevent when adding event for signal %d"
,
signals
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
src/or/main.h
+
1
−
1
View file @
2d3f88f6
...
...
@@ -60,7 +60,7 @@ MOCK_DECL(long,get_uptime,(void));
unsigned
get_signewnym_epoch
(
void
);
void
handle_signals
(
int
is_parent
);
void
process_signal
(
u
int
ptr_t
sig
);
void
process_signal
(
int
sig
);
int
try_locking
(
const
or_options_t
*
options
,
int
err_if_locked
);
int
have_lockfile
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment