From 99a753f17a5f82ae34fbbbc564757bb99666afbd Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 4 Jan 2012 20:49:47 +0000 Subject: Fix buffer full test in generic CAN driver (plus fixes to comments) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4259 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/fs/fs_stat.c | 12 ++++++------ nuttx/fs/fs_statfs.c | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'nuttx/fs') diff --git a/nuttx/fs/fs_stat.c b/nuttx/fs/fs_stat.c index 85c91bd4e..138d6a2c1 100644 --- a/nuttx/fs/fs_stat.c +++ b/nuttx/fs/fs_stat.c @@ -1,8 +1,8 @@ /**************************************************************************** * fs/fs_stat.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009 , 2012Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -187,7 +187,7 @@ int stat(const char *path, FAR struct stat *buf) if (inode->u.i_mops && inode->u.i_mops->stat) { - /* Perform the rewinddir() operation */ + /* Perform the stat() operation */ ret = inode->u.i_mops->stat(inode, relpath, buf); } @@ -215,10 +215,10 @@ int stat(const char *path, FAR struct stat *buf) /* Failure conditions always set the errno appropriately */ - errout_with_inode: +errout_with_inode: inode_release(inode); - errout: - *get_errno_ptr() = ret; +errout: + set_errno(ret); return ERROR; } diff --git a/nuttx/fs/fs_statfs.c b/nuttx/fs/fs_statfs.c index 9ce15efbf..540eb86bb 100644 --- a/nuttx/fs/fs_statfs.c +++ b/nuttx/fs/fs_statfs.c @@ -1,8 +1,8 @@ /**************************************************************************** * fs/fs_statfs.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,10 +57,10 @@ static inline int statpsuedofs(FAR struct inode *inode, FAR struct statfs *buf) { - memset(buf, 0, sizeof(struct statfs)); - buf->f_type = PROC_SUPER_MAGIC; - buf->f_namelen = NAME_MAX; - return OK; + memset(buf, 0, sizeof(struct statfs)); + buf->f_type = PROC_SUPER_MAGIC; + buf->f_namelen = NAME_MAX; + return OK; } /**************************************************************************** @@ -116,7 +116,7 @@ int statfs(FAR const char *path, FAR struct statfs *buf) goto errout; } - /* The way we handle the stat depends on the type of inode that we + /* The way we handle the statfs depends on the type of inode that we * are dealing with. */ @@ -124,12 +124,12 @@ int statfs(FAR const char *path, FAR struct statfs *buf) if (INODE_IS_MOUNTPT(inode)) { /* The node is a file system mointpoint. Verify that the mountpoint - * supports the stat() method + * supports the statfs() method */ if (inode->u.i_mops && inode->u.i_mops->statfs) { - /* Perform the rewinddir() operation */ + /* Perform the statfs() operation */ ret = inode->u.i_mops->statfs(inode, buf); } @@ -142,7 +142,7 @@ int statfs(FAR const char *path, FAR struct statfs *buf) ret = statpsuedofs(inode, buf); } - /* Check if the stat operation was successful */ + /* Check if the statfs operation was successful */ if (ret < 0) { @@ -150,16 +150,16 @@ int statfs(FAR const char *path, FAR struct statfs *buf) goto errout_with_inode; } - /* Successfully stat'ed the file */ + /* Successfully statfs'ed the file */ inode_release(inode); return OK; /* Failure conditions always set the errno appropriately */ - errout_with_inode: +errout_with_inode: inode_release(inode); - errout: - *get_errno_ptr() = ret; +errout: + set_errno(ret); return ERROR; } -- cgit v1.2.3