mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-26 21:33:15 +08:00
2010-07-01 Vinu Rajashekhar <vinutheraj@gmail.com>
PR 1529/cpukit * utime.c: Change file access time and modified time to current time if pointer to struct utimbuf is NULL. * imfs_utime.c: Upon successful completion, imfs_utime() marks the time of the last file status change, st_ctime, to be updated.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2010-07-01 Vinu Rajashekhar <vinutheraj@gmail.com>
|
||||
|
||||
PR 1529/cpukit
|
||||
* utime.c: Change file access time and modified time to
|
||||
current time if pointer to struct utimbuf is NULL.
|
||||
* imfs_utime.c: Upon successful completion, imfs_utime() marks
|
||||
the time of the last file status change, st_ctime, to be updated.
|
||||
|
||||
2010-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libcsupport/src/rtems_memalign.c, score/include/rtems/score/heap.h:
|
||||
|
||||
@@ -29,6 +29,7 @@ int utime(
|
||||
{
|
||||
rtems_filesystem_location_info_t temp_loc;
|
||||
int result;
|
||||
struct utimbuf now;
|
||||
|
||||
if ( rtems_filesystem_evaluate_path( path, strlen( path ), 0x00, &temp_loc, true ) )
|
||||
return -1;
|
||||
@@ -38,6 +39,11 @@ int utime(
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
}
|
||||
|
||||
if ( times == NULL ) {
|
||||
now.actime = now.modtime = time( NULL );
|
||||
times = &now;
|
||||
}
|
||||
|
||||
result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime );
|
||||
|
||||
rtems_filesystem_freenode( &temp_loc );
|
||||
|
||||
@@ -36,6 +36,7 @@ int IMFS_utime(
|
||||
|
||||
the_jnode->stat_atime = actime;
|
||||
the_jnode->stat_mtime = modtime;
|
||||
the_jnode->stat_ctime = time( NULL );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user