Skip to content

various: timespec/timeval.tv_sec is time_t, not long, according to POSIX #21379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Alexander Foken
Alexander Gernler <[email protected]>
Alexander Gough <[email protected]>
Alexander Hartmaier <[email protected]>
Alexander Kanavin <[email protected]>
Alexander Klimov <[email protected]>
Alexander Nikolov <[email protected]>
Alexander Smishlajev <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion dist/threads-shared/lib/threads/shared.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Config;

use Scalar::Util qw(reftype refaddr blessed);

our $VERSION = '1.68'; # Please update the pod, too.
our $VERSION = '1.69'; # Please update the pod, too.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version number is reiterated in the POD on line 1.99, so probably (as per the comment) should be updated to 1.69.

my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down
2 changes: 1 addition & 1 deletion dist/threads-shared/shared.xs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ Perl_sharedsv_cond_timedwait(perl_cond *cond, perl_mutex *mut, double abs)
struct timespec ts;
int got_it = 0;

ts.tv_sec = (long)abs;
ts.tv_sec = (time_t)abs;
abs -= (NV)ts.tv_sec;
ts.tv_nsec = (long)(abs * 1000000000.0);

Expand Down
4 changes: 2 additions & 2 deletions doio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2874,9 +2874,9 @@ nothing in the core.
else {
Zero(&utbuf, sizeof utbuf, char);
#ifdef HAS_FUTIMES
utbuf[0].tv_sec = (long)SvIV(accessed); /* time accessed */
utbuf[0].tv_sec = (time_t)SvIV(accessed); /* time accessed */
utbuf[0].tv_usec = 0;
utbuf[1].tv_sec = (long)SvIV(modified); /* time modified */
utbuf[1].tv_sec = (time_t)SvIV(modified); /* time modified */
utbuf[1].tv_usec = 0;
#elif defined(BIG_TIME)
utbuf.actime = (Time_t)SvNV(accessed); /* time accessed */
Expand Down
2 changes: 1 addition & 1 deletion pp_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ PP(pp_sselect)
value = SvNV_nomg(sv);
if (value < 0.0)
value = 0.0;
timebuf.tv_sec = (long)value;
timebuf.tv_sec = (time_t)value;
value -= (NV)timebuf.tv_sec;
timebuf.tv_usec = (long)(value * 1000000.0);
}
Expand Down