sendfile(): Fix error introduced with commit ff73be870e. Noted by Maciej Wójcik

This commit is contained in:
Gregory Nutt 2017-03-05 11:50:34 -06:00
parent 077f0d6c1b
commit d3408809e4
2 changed files with 3 additions and 4 deletions

View File

@ -2060,4 +2060,4 @@
#define HRTIM_BDMADR_SHIFT 0 /* Bits 0-31: Burst DMA Data register */ #define HRTIM_BDMADR_SHIFT 0 /* Bits 0-31: Burst DMA Data register */
#define HRTIM_BDMADR_MASK (0xffffffff << HRTIM_BDMADR_SHIFT) #define HRTIM_BDMADR_MASK (0xffffffff << HRTIM_BDMADR_SHIFT)
#endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_HRTIM_H */ #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_HRTIM_H */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* fs/vfs/fs_sendfile.c * fs/vfs/fs_sendfile.c
* *
* Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2009, 2011, 2013, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -103,7 +103,6 @@
ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count) ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count)
{ {
#if defined(CONFIG_NET_TCP) && CONFIG_NSOCKET_DESCRIPTORS > 0 #if defined(CONFIG_NET_TCP) && CONFIG_NSOCKET_DESCRIPTORS > 0
/* Check the destination file descriptor: Is it a (probable) file /* Check the destination file descriptor: Is it a (probable) file
* descriptor? Check the source file: Is it a normal file? * descriptor? Check the source file: Is it a normal file?
*/ */
@ -117,7 +116,7 @@ ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count)
* structure. * structure.
*/ */
filep = fs_getfilep(fd); filep = fs_getfilep(infd);
if (!filep) if (!filep)
{ {
/* The errno value has already been set */ /* The errno value has already been set */