mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
Several webserver bugs fixed
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@391 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+19
-12
@@ -1,5 +1,5 @@
|
||||
############################################################
|
||||
# Makefile
|
||||
############################################################################
|
||||
# fs/Makefile
|
||||
#
|
||||
# Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
@@ -31,7 +31,7 @@
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
@@ -40,22 +40,29 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
ASRCS =
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
|
||||
CSRCS = fs_open.c fs_close.c fs_read.c fs_write.c fs_ioctl.c fs_dup.c \
|
||||
fs_opendir.c fs_closedir.c fs_stat.c fs_readdir.c fs_readdirr.c \
|
||||
fs_seekdir.c fs_telldir.c fs_rewinddir.c fs_files.c \
|
||||
fs_inode.c fs_inodefind.c fs_inodereserve.c fs_statfs.c \
|
||||
fs_inoderemove.c fs_registerdriver.c fs_unregisterdriver.c \
|
||||
fs_inodeaddref.c fs_inoderelease.c
|
||||
CSRCS =
|
||||
ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
|
||||
ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
|
||||
CSRCS += fs_close.c fs_write.c fs_ioctl.c
|
||||
endif
|
||||
else
|
||||
CSRCS += fs_open.c fs_close.c fs_read.c fs_write.c fs_ioctl.c fs_dup.c \
|
||||
fs_opendir.c fs_closedir.c fs_stat.c fs_readdir.c fs_readdirr.c \
|
||||
fs_seekdir.c fs_telldir.c fs_rewinddir.c fs_files.c \
|
||||
fs_inode.c fs_inodefind.c fs_inodereserve.c fs_statfs.c \
|
||||
fs_inoderemove.c fs_registerdriver.c fs_unregisterdriver.c \
|
||||
fs_inodeaddref.c fs_inoderelease.c
|
||||
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
|
||||
CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c \
|
||||
fs_mount.c fs_umount.c \
|
||||
fs_fsync.c fs_unlink.c fs_rename.c \
|
||||
fs_mkdir.c fs_rmdir.c
|
||||
fs_mount.c fs_umount.c \
|
||||
fs_fsync.c fs_unlink.c fs_rename.c \
|
||||
fs_mkdir.c fs_rmdir.c
|
||||
|
||||
ifeq ($(CONFIG_FS_FAT),y)
|
||||
CSRCS += fs_fat32.c fs_fat32util.c fs_fat32attrib.c
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
|
||||
+18
-13
@@ -1,5 +1,5 @@
|
||||
/************************************************************
|
||||
* fs_write.c
|
||||
/****************************************************************************
|
||||
* fs/fs_write.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
@@ -31,15 +31,15 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Compilation Switches
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
@@ -54,11 +54,11 @@
|
||||
|
||||
#include "fs_internal.h"
|
||||
|
||||
/************************************************************
|
||||
* Global Functions
|
||||
************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Global Functions
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************************
|
||||
* Function: send
|
||||
*
|
||||
* Description:
|
||||
@@ -106,15 +106,17 @@
|
||||
*
|
||||
* Assumptions:
|
||||
*
|
||||
****************************************************************************/
|
||||
********************************************************************************************/
|
||||
|
||||
int write(int fd, const void *buf, unsigned int nbytes)
|
||||
{
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
FAR struct filelist *list;
|
||||
FAR struct file *this_file;
|
||||
FAR struct inode *inode;
|
||||
int err;
|
||||
int ret;
|
||||
#endif
|
||||
int err;
|
||||
|
||||
/* Did we get a valid file descriptor? */
|
||||
|
||||
@@ -135,6 +137,8 @@ int write(int fd, const void *buf, unsigned int nbytes)
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
|
||||
/* Get the thread-specific file list */
|
||||
|
||||
list = sched_getfiles();
|
||||
@@ -172,6 +176,7 @@ int write(int fd, const void *buf, unsigned int nbytes)
|
||||
}
|
||||
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
errout:
|
||||
*get_errno_ptr() = err;
|
||||
|
||||
Reference in New Issue
Block a user