From c5982980471eba9909009b5ee557198797f2d485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 30 Nov 2009 08:31:31 +0000 Subject: [PATCH] * Cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34363 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/unistd/dup.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/system/libroot/posix/unistd/dup.c b/src/system/libroot/posix/unistd/dup.c index 03ec769213..a585a9ad4d 100644 --- a/src/system/libroot/posix/unistd/dup.c +++ b/src/system/libroot/posix/unistd/dup.c @@ -1,35 +1,25 @@ -/* - * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +/* + * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ -#include -#include #include +#include + +#include +#include int dup(int fd) { - int status = _kern_dup(fd); - if (status < 0) { - errno = status; - status = -1; - } - - return status; + RETURN_AND_SET_ERRNO(_kern_dup(fd)); } int dup2(int oldFD, int newFD) { - int status = _kern_dup2(oldFD, newFD); - if (status < 0) { - errno = status; - status = -1; - } - - return status; + RETURN_AND_SET_ERRNO(_kern_dup2(oldFD, newFD)); }