mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-21 01:38:25 +08:00
psxfile01: Fix one second sleep
Checking of atime in psxfile01 (line 713) can fail since a delay for rtems_clock_get_ticks_per_second (line 699) gives a delay of less than one second, depending on when the last tick occurred. atime is measured in whole seconds, and a fast processor might read the file before a new second occurs. Add one tick to the delay will solve the problem.
This commit is contained in:
committed by
Sebastian Huber
parent
9c12bcfdc5
commit
5b951175d0
@@ -696,7 +696,7 @@ since new path is not valid");
|
||||
ctime2 = buf.st_ctime;
|
||||
|
||||
|
||||
status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
|
||||
status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() + 1);
|
||||
rewind( file );
|
||||
while ( fgets(buffer, 128, file) )
|
||||
printf( "%s", buffer );
|
||||
|
||||
Reference in New Issue
Block a user