mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
2003-02-03 Till Straumann <strauman@slac.stanford.edu>
PR 339/filesystem * src/chroot.c: Fix violation of FS node object copy semantics.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2003-02-03 Till Straumann <strauman@slac.stanford.edu>
|
||||
|
||||
PR 339/filesystem
|
||||
* src/chroot.c: Fix violation of FS node object copy semantics.
|
||||
|
||||
2003-01-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* Makefile.am: Eliminate OBJS.
|
||||
|
||||
@@ -38,14 +38,17 @@ int chroot(
|
||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||
};
|
||||
|
||||
loc = rtems_filesystem_root; /* save the value */
|
||||
|
||||
result = chdir(pathname);
|
||||
if (result) {
|
||||
rtems_filesystem_root = loc; /* restore the value */
|
||||
rtems_set_errno_and_return_minus_one( errno );
|
||||
};
|
||||
rtems_filesystem_root = rtems_filesystem_current;
|
||||
/* clone the new root location */
|
||||
if (rtems_filesystem_evaluate_path(".", 0, &loc, 0)) {
|
||||
/* our cwd has changed, though - but there is no easy way of return :-( */
|
||||
rtems_set_errno_and_return_minus_one( errno );
|
||||
}
|
||||
rtems_filesystem_freenode(&rtems_filesystem_root);
|
||||
rtems_filesystem_root = loc;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user