source: rtems/c/src/lib/libc/utime.c @ 0cb7cb9

4.104.114.84.95
Last change on this file since 0cb7cb9 was dd0f326, checked in by Joel Sherrill <joel.sherrill@…>, on 10/12/99 at 19:10:46

Added rtems_filesystem_freenode() macro and added calls at appropriate
places to make sure memory allocated for filesystem specifif nodes
gets freed.

  • Property mode set to 100644
File size: 954 bytes
Line 
1/*
2 *  utime() - POSIX 1003.1b 5.5.6 - Set File Access and Modification Times
3 *
4 *  COPYRIGHT (c) 1989-1998.
5 *  On-Line Applications Research Corporation (OAR).
6 *  Copyright assigned to U.S. Government, 1994.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include <sys/types.h>
16#include <utime.h>
17#include <errno.h>
18
19#include "libio_.h"
20
21int utime(
22  const char           *path,
23  const struct utimbuf *times
24)
25{
26  rtems_filesystem_location_info_t   temp_loc;
27  int                                result;
28
29  if ( !temp_loc.ops->utime )
30    set_errno_and_return_minus_one( ENOTSUP );
31
32  if ( rtems_filesystem_evaluate_path( path, 0x00, &temp_loc, TRUE ) )
33    return -1;
34
35  result = (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime );
36
37  rtems_filesystem_freenode( &temp_loc );
38
39  return result;
40}
Note: See TracBrowser for help on using the repository browser.