source: rtems/c/src/lib/libc/utime.c @ cff0d64

4.104.114.84.95
Last change on this file since cff0d64 was efb5450, checked in by Joel Sherrill <joel.sherrill@…>, on 10/17/01 at 17:57:42

2001-10-17 Till Straumann <strauman@…>

  • These changes were discussed and reviewed by many people but the primary people were Jennifer Averett <jennifer@…> and Eugeny Mints <jack@…>.
  • libc/utime.c: Add missing call to rtems_filesystem_freenode() at verification that utime is supported by the filesystem.
  • libc/link.c: Remove calls to freenode when the node was not successfully allocated.
  • libc/unmount.c: In the method file_systems_below_this_mountpoint() added calls to correctly free fs_root_loc when a failure occurs.
  • libc/open.c: Add freenode calls upon failure.
  • libc/open.c, lib/libc/close.c: (PENDING -- NOT INCLUDED THIS TIMER) Modifications the move the freenode from open() to close() (also part of this patch) are pending further discussion.
  • Property mode set to 100644
File size: 1010 bytes
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.OARcorp.com/rtems/license.html.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <sys/types.h>
19#include <utime.h>
20#include <errno.h>
21
22#include <rtems/libio_.h>
23
24int utime(
25  const char           *path,
26  const struct utimbuf *times
27)
28{
29  rtems_filesystem_location_info_t   temp_loc;
30  int                                result;
31
32  if ( rtems_filesystem_evaluate_path( path, 0x00, &temp_loc, TRUE ) )
33    return -1;
34
35  if ( !temp_loc.ops->utime_h ){
36    rtems_filesystem_freenode( &temp_loc );
37    set_errno_and_return_minus_one( ENOTSUP );
38  }
39
40  result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime );
41
42  rtems_filesystem_freenode( &temp_loc );
43
44  return result;
45}
Note: See TracBrowser for help on using the repository browser.