mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-30 19:07:47 +08:00
2010-07-22 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1627/testing * libfs/src/devfs/devstat.c:
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2010-07-22 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
PR 1627/testing
|
||||
* libfs/src/devfs/devstat.c:
|
||||
|
||||
2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* libcsupport/src/link.c: Do not overwrite errno with return status.
|
||||
|
||||
@@ -27,13 +27,19 @@ int devFS_stat(
|
||||
rtems_device_name_t *the_dev;
|
||||
|
||||
the_dev = (rtems_device_name_t *)loc->node_access;
|
||||
if (!the_dev)
|
||||
rtems_set_errno_and_return_minus_one( EFAULT );
|
||||
|
||||
/*
|
||||
* stat() invokes devFS_evaluate_path() which checks that node_access
|
||||
* is not NULL. So this should NEVER be NULL unless someone breaks
|
||||
* other code in this filesystem.
|
||||
*/
|
||||
#if defined(RTEMS_DEBUG)
|
||||
if (!the_dev)
|
||||
rtems_set_errno_and_return_minus_one( EFAULT );
|
||||
#endif
|
||||
|
||||
buf->st_rdev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor );
|
||||
|
||||
buf->st_mode = the_dev->mode;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user