Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
77685300
Commit
77685300
authored
May 24, 2000
by
David Lawrence
Browse files
cast isc_time_seconds to long when assigning to a timeval.tv_sec, and explain
why this is an ok thing to do. shuts up the irix compiler.
parent
389b5c85
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/isc/unix/file.c
View file @
77685300
...
...
@@ -77,9 +77,16 @@ isc_file_settime(const char *file, isc_time_t *time) {
/*
* tv_sec is at least a 32 bit quantity on all platforms we're
* dealing with, but it is signed on most (all?) of them,
* so we need to make sure the high bit isn't set.
* so we need to make sure the high bit isn't set. This unfortunately
* loses when either:
* * tv_sec becomes a signed 64 bit integer but long is 32 bits
* and isc_time_seconds > LONG_MAX, or
* * isc_time_seconds is changed to be > 32 bits but long is 32 bits
* and isc_time_seconds has at least 33 significant bits.
*/
times
[
0
].
tv_sec
=
times
[
1
].
tv_sec
=
isc_time_seconds
(
time
);
times
[
0
].
tv_sec
=
times
[
1
].
tv_sec
=
(
long
)
isc_time_seconds
(
time
);
if
((
times
[
0
].
tv_sec
&
(
1
<<
(
sizeof
(
times
[
0
].
tv_sec
)
*
8
-
1
)))
!=
0
)
return
(
ISC_R_RANGE
);
...
...
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