From patchwork Wed Jul 13 12:17:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 647875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rqHsp4h7Mz9sxb for ; Wed, 13 Jul 2016 22:18:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=Hcvymlmj; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= MPyx1deCUoUJmLic8OlhQpDOP6TFYjqU18Cb4LSyho1hJb0D8cZa2xcAFYEcrsZz kLkOWm3rPxw8L+6H2wzPPVeFH8P9TiPhSFc1cVnz9gFWsfCC6YQ3lQqCQB7wsn8m byI+bpMiYyQW51nqWs75BI+3JL7FfNPBWZrcIfiT2vA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=/IXS4h NKJWv4oLy1WRxJRorJINA=; b=HcvymlmjPm7Qb7NIXHALFfbChnMVB0EhcCK1ZY QESrz+tbZZAg+Bl/YGZrqLMTH7QphJ7Bikxg6N2oq0eS36hmM/FGsL4M3Lyh6dch CG8lz6lIgvAjXc7k6SenC08g1Hw2Y+5caNdcgOAT1zKl/esWvSxC3AaW0pKG7svO c+rR4= Received: (qmail 52505 invoked by alias); 13 Jul 2016 12:17:59 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 52487 invoked by uid 89); 13 Jul 2016 12:17:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Destination, sln X-HELO: mx1.redhat.com Date: Wed, 13 Jul 2016 14:17:45 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] sln: Preprocessor cleanups User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20160713121745.C2BD8401AE80B@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2016-07-13 Florian Weimer * elf/sln.c: Remove HAV_CONFIG_H, S_ISDIR, S_ISLNK preprocessor conditionals. Do not define PATH_MAX. diff --git a/elf/sln.c b/elf/sln.c index f52cb9f..fa4ccec 100644 --- a/elf/sln.c +++ b/elf/sln.c @@ -16,10 +16,6 @@ License along with the GNU C Library; if not, see . */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #include #include #include @@ -37,10 +33,6 @@ #define PACKAGE _libc_intl_domainname -#if !defined S_ISDIR && defined S_IFDIR -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif - static int makesymlink (const char *src, const char *dest); static int makesymlinks (const char *file); static void usage (void); @@ -89,9 +81,6 @@ usage (void) static int makesymlinks (const char *file) { -#ifndef PATH_MAX -#define PATH_MAX 4095 -#endif char *buffer = NULL; size_t bufferlen = 0; int ret; @@ -190,11 +179,7 @@ makesymlink (const char *src, const char *dest) return -1; } -#ifdef S_ISLNK if (symlink (src, dest) == 0) -#else - if (link (src, dest) == 0) -#endif { /* Destination must exist by now. */ if (access (dest, F_OK))