tests: treat tv_sec/tv_usec as signed types in futimesat and utimes tests
* tests/futimesat.c: Print tv_sec and tv_usec fields as signed types. * tests/utimes.c: Likewise.
This commit is contained in:
parent
7491519823
commit
0bf550423c
@ -32,14 +32,11 @@
|
||||
|
||||
#ifdef __NR_futimesat
|
||||
|
||||
# include <stdint.h>
|
||||
# include <stdio.h>
|
||||
# include <sys/time.h>
|
||||
# include <unistd.h>
|
||||
|
||||
#define CAST_NUM(n) \
|
||||
(sizeof(n) == sizeof(long) ? \
|
||||
(unsigned long long) (unsigned long) (n) : \
|
||||
(unsigned long long) (n))
|
||||
|
||||
int
|
||||
main(void)
|
||||
@ -69,10 +66,10 @@ main(void)
|
||||
|
||||
(void) close(0);
|
||||
rc = syscall(__NR_futimesat, 0, "", ts);
|
||||
printf("futimesat(0, \"\", [{tv_sec=%llu, tv_usec=%llu}, "
|
||||
"{tv_sec=%llu, tv_usec=%llu}]) = %ld %s (%m)\n",
|
||||
CAST_NUM(ts[0].tv_sec), CAST_NUM(ts[0].tv_usec),
|
||||
CAST_NUM(ts[1].tv_sec), CAST_NUM(ts[1].tv_usec),
|
||||
printf("futimesat(0, \"\", [{tv_sec=%jd, tv_usec=%jd}, "
|
||||
"{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n",
|
||||
(intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec,
|
||||
(intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec,
|
||||
rc, errno2name());
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
|
@ -32,15 +32,11 @@
|
||||
|
||||
#ifdef __NR_utimes
|
||||
|
||||
# include <stdint.h>
|
||||
# include <stdio.h>
|
||||
# include <sys/time.h>
|
||||
# include <unistd.h>
|
||||
|
||||
#define CAST_NUM(n) \
|
||||
(sizeof(n) == sizeof(long) ? \
|
||||
(unsigned long long) (unsigned long) (n) : \
|
||||
(unsigned long long) (n))
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
@ -66,10 +62,10 @@ main(void)
|
||||
ts[1].tv_usec = tv.tv_usec + 1;
|
||||
|
||||
rc = syscall(__NR_utimes, "", ts);
|
||||
printf("utimes(\"\", [{tv_sec=%llu, tv_usec=%llu}, "
|
||||
"{tv_sec=%llu, tv_usec=%llu}]) = %ld %s (%m)\n",
|
||||
CAST_NUM(ts[0].tv_sec), CAST_NUM(ts[0].tv_usec),
|
||||
CAST_NUM(ts[1].tv_sec), CAST_NUM(ts[1].tv_usec),
|
||||
printf("utimes(\"\", [{tv_sec=%jd, tv_usec=%jd}, "
|
||||
"{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n",
|
||||
(intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec,
|
||||
(intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec,
|
||||
rc, errno2name());
|
||||
|
||||
puts("+++ exited with 0 +++");
|
||||
|
Loading…
x
Reference in New Issue
Block a user