From patchwork Thu Sep 13 05:34:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Ren X-Patchwork-Id: 969255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=c-sky.com Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 429nQs5VnJz9s3x for ; Thu, 13 Sep 2018 15:34:43 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 1ECCC10057; Thu, 13 Sep 2018 07:34:39 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mail142-16.mail.alibaba.com (mail142-16.mail.alibaba.com [198.11.142.16]) by helium.openadk.org (Postfix) with ESMTPS id 44F1510057; Thu, 13 Sep 2018 07:34:30 +0200 (CEST) X-Alimail-AntiSpam: AC=CONTINUE; BC=0.07651845|-1; CH=blue; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03299; MF=ren_guo@c-sky.com; NM=1; PH=DS; RN=3; RT=3; SR=0; TI=SMTPD_---.CqB8j44_1536816854; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CqB8j44_1536816854) by smtp.aliyun-inc.com(10.147.42.135); Thu, 13 Sep 2018 13:34:14 +0800 From: Guo Ren To: devel@uclibc-ng.org, wbx@uclibc-ng.org Date: Thu, 13 Sep 2018 13:34:12 +0800 Message-Id: <1536816852-10981-1-git-send-email-ren_guo@c-sky.com> X-Mailer: git-send-email 2.7.4 Cc: Guo Ren Subject: [uclibc-ng-devel] [PATCH] bugfix renameat2 wrong implement. X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Signed-off-by: Guo Ren --- libc/sysdeps/linux/common/rename.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc/sysdeps/linux/common/rename.c b/libc/sysdeps/linux/common/rename.c index 30a4ed7..613ae4e 100644 --- a/libc/sysdeps/linux/common/rename.c +++ b/libc/sysdeps/linux/common/rename.c @@ -20,7 +20,9 @@ int rename(const char *oldpath, const char *newpath) # include int rename(const char *oldpath, const char *newpath) { - _syscall2(int, renameat2, const char *, oldpath, const char *, newpath) + _syscall5(int, renameat2, int, olddfd, const char *, oldpath, + int, newdfd, const char *, newpath, int, flags) + return renameat2(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0); } #else _syscall2(int, rename, const char *, oldpath, const char *, newpath)