summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>1999-08-15 14:22:30 +0000
committermarcel <marcel@FreeBSD.org>1999-08-15 14:22:30 +0000
commit4b99c12e08c41fedc53a407782700f2ee9dbf162 (patch)
tree867b06411ebe766d164c0b6cd1a9999db5b707d0 /sys/i386/linux
parent3760a527a6a6a7e9954754f6748ae28b587e8b26 (diff)
downloadFreeBSD-src-4b99c12e08c41fedc53a407782700f2ee9dbf162.zip
FreeBSD-src-4b99c12e08c41fedc53a407782700f2ee9dbf162.tar.gz
Fix bug in the fcntl syscall where 'arg' was not set properly.
PR: 12147 Submitted by: Allan Saddi <asaddi@philosophysw.com>
Diffstat (limited to 'sys/i386/linux')
-rw-r--r--sys/i386/linux/linux_file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/i386/linux/linux_file.c b/sys/i386/linux/linux_file.c
index e3d411c..a5b051f 100644
--- a/sys/i386/linux/linux_file.c
+++ b/sys/i386/linux/linux_file.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_file.c,v 1.29 1999/08/13 09:27:54 marcel Exp $
+ * $Id: linux_file.c,v 1.30 1999/08/14 18:20:44 marcel Exp $
*/
#include "opt_compat.h"
@@ -217,11 +217,11 @@ linux_fcntl(struct proc *p, struct linux_fcntl_args *args)
p->p_pid, args->fd, args->cmd);
#endif
fcntl_args.fd = args->fd;
- fcntl_args.arg = 0;
switch (args->cmd) {
case LINUX_F_DUPFD:
fcntl_args.cmd = F_DUPFD;
+ fcntl_args.arg = args->arg;
return fcntl(p, &fcntl_args);
case LINUX_F_GETFD:
@@ -230,6 +230,7 @@ linux_fcntl(struct proc *p, struct linux_fcntl_args *args)
case LINUX_F_SETFD:
fcntl_args.cmd = F_SETFD;
+ fcntl_args.arg = args->arg;
return fcntl(p, &fcntl_args);
case LINUX_F_GETFL:
@@ -247,6 +248,7 @@ linux_fcntl(struct proc *p, struct linux_fcntl_args *args)
return error;
case LINUX_F_SETFL:
+ fcntl_args.arg = 0;
if (args->arg & LINUX_O_NDELAY) fcntl_args.arg |= O_NONBLOCK;
if (args->arg & LINUX_O_APPEND) fcntl_args.arg |= O_APPEND;
if (args->arg & LINUX_O_SYNC) fcntl_args.arg |= O_FSYNC;
OpenPOWER on IntegriCloud