From patchwork Sat Dec 26 17:49:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1?= X-Patchwork-Id: 41560 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BCF273851C21; Sat, 26 Dec 2020 17:49:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCF273851C21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609004986; bh=Z4RCz6pUkE15GUQmlETYJhVhAmijPugrbPO49yuA7JQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=RmdLpZfnMJd0B68W2AUlxI7ETDt02LNE3qZYZfZriBVjQW4Ja41Pol3+ZQyi6sdni wN7FYk5Uk8Ylt+7VGpJ7tCjzGmE1lfBlTBEHCtG2wTQHObvOhLh2Ichp/DSWp9ja4g F+6zTJJZZjM91EB+8Nv05vbBuzWGSk/0VP7TxEms= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by sourceware.org (Postfix) with UTF8SMTPS id 54D163857832 for ; Sat, 26 Dec 2020 17:49:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 54D163857832 Received: by mail-ed1-x529.google.com with SMTP id b73so6226740edf.13 for ; Sat, 26 Dec 2020 09:49:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Z4RCz6pUkE15GUQmlETYJhVhAmijPugrbPO49yuA7JQ=; b=B2o4wZZEjHHfYpcPJjIx2CcbusdaTh4GctJXVYvFntEThCwHY0UHOtxcim4+UqaxGH TTqdegrTSNVIIjh69cnA2YQU9U87GJcR0M8z4N3tPI3yp5cEvqyx7xW8PbCFP2gYHtoM KYlVHycy7Dy+62Qoz3XHUDesl24qUAavxipnGc9IWkz+g7qYobHoH3roKvRP6w/OtAb+ umj2/h/N6ypOr934hOUYx7H0NNdlq9s0Sb+QObGvzHyZatIpDTKzsIPq5LyNggnA/lVh b0lONP14cawC+ljCyld/MEEsILQflppVEj8PQ25E+vmk6tXKPf1u8GaQZ9YnexEk3ZMN VPRA== X-Gm-Message-State: AOAM532le0cDK3VuqGJ+75spD3XtIYJdcsSn6UnDXJ0sIgfKjJOFx1Hy Sj/PGXtU9YjFWOB+RNyiPA94CsVBZ7Q= X-Google-Smtp-Source: ABdhPJw+Gw5kmiylz+VZaHCFvMyBS6EkR8VjPZWXP0ES2EpSBdoZlo/jOnnPGw7AodnqfzYuKJ63uA== X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr35471749edv.100.1609004983514; Sat, 26 Dec 2020 09:49:43 -0800 (PST) Received: from picard.redhat.com (ip-244-183.pel.cz. [213.226.244.183]) by smtp.gmail.com with ESMTPSA id dh19sm25772385edb.78.2020.12.26.09.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Dec 2020 09:49:42 -0800 (PST) X-Google-Original-From: =?unknown-8bit?q?Alexandra_H=C3=A1jkov=C3=A1_ahajkov?= =?unknown-8bit?q?a=40redhat=2Ecom?= To: libc-alpha@sourceware.org Subject: [PATCH] Add xchdir to libsupport. Date: Sat, 26 Dec 2020 18:49:36 +0100 Message-Id: <20201226174936.985576-1-ahajkova@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Status: No, score=-14.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1_via_Libc-alpha?= From: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1?= Reply-To: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1?= Cc: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1?= Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" From: Alexandra Hájková --- Adding xchdir is need for my pending execveat syscall wrapper patch. support/xchdir.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 support/xchdir.c diff --git a/support/xchdir.c b/support/xchdir.c new file mode 100644 index 0000000000..206f17857d --- /dev/null +++ b/support/xchdir.c @@ -0,0 +1,27 @@ +/* chdir with error checking. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +void +chdir(const char *path) +{ + if (chdir(path) != 0) + FAIL_EXIT1 ("chdir (\"%s\"): %m", path); +}