forked from Imagelibrary/binutils-gdb
PR27725, better objcopy -p times
Nanosecond rather than second resolution. PR 27725 * configure.ac: Check for sys/time.h and utimensat. Use standard checks for mkstemp and mkdtemp. Whitespace. Check for nanosecond members of struct stat. * rename.c: Prefer sys/time.h for utimes over utime.h for utime. (STAT_TIMESPEC, STAT_TIMESPEC_NS): Define (get_stat_atime_ns, get_stat_mtime_ns): New inline functions. (get_stat_atime, get_stat_mtime): Likewise. (set_times): Choose first available of utimensat, utimes, utime. Use above inline functions to set timespec and timeval values. * configure: Regenerate. * config.in: Regenerate. * testsuite/binutils-all/objcopy.exp (objcopy_test): Add test of file timestamp when --preserve-dates is used.
This commit is contained in:
@@ -77,6 +77,7 @@ proc objcopy_test {testname srcfile type asflags ldflags} {
|
||||
return
|
||||
}
|
||||
set xflags "--preserve-dates"
|
||||
sleep 1
|
||||
}
|
||||
|
||||
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS $xflags $t_tempfile $t_copyfile"]
|
||||
@@ -102,6 +103,17 @@ proc objcopy_test {testname srcfile type asflags ldflags} {
|
||||
|
||||
if [string equal "" $exec_output] then {
|
||||
pass "objcopy $type ($testname)"
|
||||
if { $type == "executable" } {
|
||||
set dir [file dirname $t_copyfile]
|
||||
set f2 [file tail $t_copyfile]
|
||||
set status [remote_exec host find "$dir -name $f2 -newer $t_tempfile -print"]
|
||||
set exec_output [lindex $status 1]
|
||||
if [string equal "" $exec_output] then {
|
||||
pass "objcopy $type ($testname) timestamp"
|
||||
} else {
|
||||
fail "objcopy $type ($testname) timestamp"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
send_log "$exec_output\n"
|
||||
verbose "$exec_output" 1
|
||||
|
||||
Reference in New Issue
Block a user