Bash-5.3-alpha release

This commit is contained in:
Chet Ramey
2024-04-22 10:33:38 -04:00
parent f3b6bd1945
commit 622d318652
700 changed files with 136534 additions and 96420 deletions
+9 -16
View File
@@ -1,6 +1,6 @@
/* clock.c - operations on struct tms and clock_t's */
/* Copyright (C) 1999 Free Software Foundation, Inc.
/* Copyright (C) 1999,2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -24,10 +24,7 @@
#include <sys/types.h>
#include <posixtime.h>
#if defined (HAVE_SYS_TIMES_H)
# include <sys/times.h>
#endif
#include <systimes.h>
#include <stdio.h>
#include <stdc.h>
@@ -35,16 +32,13 @@
#include <bashintl.h>
#ifndef locale_decpoint
extern int locale_decpoint PARAMS((void));
extern int locale_decpoint (void);
#endif
extern long get_clk_tck PARAMS((void));
extern long get_clk_tck (void);
void
clock_t_to_secs (t, sp, sfp)
clock_t t;
time_t *sp;
int *sfp;
clock_t_to_secs (clock_t t, time_t *sp, long *sfp)
{
static long clk_tck = -1;
@@ -69,19 +63,18 @@ clock_t_to_secs (t, sp, sfp)
terms of the value of CLK_TCK, which is what is returned by the
`times' call. */
void
print_clock_t (fp, t)
FILE *fp;
clock_t t;
print_clock_t (FILE *fp, clock_t t)
{
time_t timestamp;
long minutes;
int seconds, seconds_fraction;
int seconds;
long seconds_fraction;
clock_t_to_secs (t, &timestamp, &seconds_fraction);
minutes = timestamp / 60;
seconds = timestamp % 60;
fprintf (fp, "%ldm%d%c%03ds", minutes, seconds, locale_decpoint(), seconds_fraction);
fprintf (fp, "%ldm%d%c%03lds", minutes, seconds, locale_decpoint(), seconds_fraction);
}
#endif /* HAVE_TIMES */