source: rtems/cpukit/libcsupport/src/utime.c @ 9b4422a2

4.11
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on May 3, 2012 at 3:09:24 PM

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  utime() - POSIX 1003.1b 5.5.6 - Set File Access and Modification Times
3 *
4 *  COPYRIGHT (c) 1989-1999.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13  #include "config.h"
14#endif
15
16/* FIXME: This include is a workaround for a broken <utime.h> in Newlib */
17#include <sys/types.h>
18
19#include <utime.h>
20
21#include <rtems/libio_.h>
22
23int utime( const char *path, const struct utimbuf *times )
24{
25  int rv = 0;
26  rtems_filesystem_eval_path_context_t ctx;
27  int eval_flags = RTEMS_FS_FOLLOW_LINK;
28  const rtems_filesystem_location_info_t *currentloc =
29    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
30  struct utimbuf now_times;
31
32  if ( times == NULL ) {
33    time_t now = time( NULL );
34
35    now_times.actime = now;
36    now_times.modtime = now;
37
38    times = &now_times;
39  }
40
41  rv = (*currentloc->ops->utime_h)(
42    currentloc,
43    times->actime,
44    times->modtime
45  );
46
47  rtems_filesystem_eval_path_cleanup( &ctx );
48
49  return rv;
50}
Note: See TracBrowser for help on using the repository browser.