From 0235fc3a62438e94e1e9974597937b3edba3dbfc Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 15 Feb 2014 21:52:32 +0100 Subject: [PATCH] Fix wrong return value for fcntl(F_SETFL, ...). --- sortix/io.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sortix/io.cpp b/sortix/io.cpp index 07e0e052..f462bc6a 100644 --- a/sortix/io.cpp +++ b/sortix/io.cpp @@ -331,7 +331,7 @@ static int sys_fcntl(int fd, int cmd, uintptr_t arg) // Operations on the file descriptior. if ( cmd == F_SETFD ) - return dtable->SetFlags(fd, (int) arg) ? 0 : -1;; + return dtable->SetFlags(fd, (int) arg) ? 0 : -1; if ( cmd == F_GETFD ) return dtable->GetFlags(fd); @@ -345,7 +345,7 @@ static int sys_fcntl(int fd, int cmd, uintptr_t arg) if ( !desc ) return -1; if ( cmd == F_SETFL ) - return desc->SetFlags((int) arg); + return desc->SetFlags((int) arg) ? 0 : -1; if ( cmd == F_GETFL ) return desc->GetFlags();