From patchwork Sat Nov 3 12:50:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1692261 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A5E71DFB7B for ; Sat, 3 Nov 2012 12:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932089Ab2KCMur (ORCPT ); Sat, 3 Nov 2012 08:50:47 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:50361 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932075Ab2KCMuq (ORCPT ); Sat, 3 Nov 2012 08:50:46 -0400 Received: by mail-gh0-f174.google.com with SMTP id g15so789442ghb.19 for ; Sat, 03 Nov 2012 05:50:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=QN810xp4aeX7o1znonubPjQnaBwhFbPA/sXWsufPtRU=; b=ON0bFxejAmfbkDfypODPxpZqpJoznDk/3PMn2aIrqKvq8/nR0Wzithfy2uOxWKIqtW L5863Pf6mtf2xiW+vxFcwiXnzsMYfqG+uDeE4e6tlh50V5K2JTizCtkevwk1Imh2fEtj UMEdMFfz2EzssrG5ndBX2fLDpUJgNzlMtwl2APjpQvytjqiwyt6w3hsQaihhJ5FtIfUT g/fRUV6yctBmQFnOmxUBjYjd7a4Y5XgMGy7IBIKlnySJzvht+8JTjQQ+EsaEdJRXOIgW XrEBHuLn9OWi4Gww7ZhhMcnTaF+7zGytFqYBcaEWtLZJGPocQuY38pMvPg+6TxFlPMSt ZbFg== Received: by 10.100.244.28 with SMTP id r28mr1111686anh.65.1351947046563; Sat, 03 Nov 2012 05:50:46 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-107-015-110-129.nc.res.rr.com. [107.15.110.129]) by mx.google.com with ESMTPS id n13sm11145727ano.20.2012.11.03.05.50.45 (version=SSLv3 cipher=OTHER); Sat, 03 Nov 2012 05:50:45 -0700 (PDT) From: Jeff Layton To: linux-cifs@vger.kernel.org Cc: shirishpargaonkar@gmail.com Subject: [PATCH 04/17] get/setcifsacl: set "prog" via basename(argv[0]) Date: Sat, 3 Nov 2012 08:50:21 -0400 Message-Id: <1351947034-18876-5-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1351947034-18876-1-git-send-email-jlayton@samba.org> References: <1351947034-18876-1-git-send-email-jlayton@samba.org> X-Gm-Message-State: ALoCoQlSqCzYq1mF4xALuqENwKoT/AH9XyFaLW35qTDkBQuyMn7htWmii1gAR45RCgJ7rTJ0QZxl Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org This saves a tiny bit of memory, and doesn't make the program assume that the binary is named something in particular. Signed-off-by: Jeff Layton --- getcifsacl.c | 3 ++- setcifsacl.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/getcifsacl.c b/getcifsacl.c index 8cbdb1d..da4bb67 100644 --- a/getcifsacl.c +++ b/getcifsacl.c @@ -38,7 +38,7 @@ #include #include "cifsacl.h" -static const char *prog = "getcifsacl"; +static const char *prog; static void print_each_ace_mask(uint32_t mask) @@ -333,6 +333,7 @@ main(const int argc, char *const argv[]) size_t bufsize = BUFSIZE; char *filename, *attrval; + prog = basename(argv[0]); openlog(prog, 0, LOG_DAEMON); while ((c = getopt_long(argc, argv, "r:v", NULL, NULL)) != -1) { diff --git a/setcifsacl.c b/setcifsacl.c index 380adac..50822e6 100644 --- a/setcifsacl.c +++ b/setcifsacl.c @@ -39,7 +39,7 @@ #include #include "cifsacl.h" -static const char *prog = "setcifsacl"; +static const char *prog; static void copy_sec_desc(const struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd, @@ -775,6 +775,8 @@ main(const int argc, char *const argv[]) struct cifs_ace **cacesptr = NULL, **facesptr = NULL; struct cifs_ntsd *ntsdptr = NULL; + prog = basename(argv[0]); + openlog(prog, 0, LOG_DAEMON); c = getopt(argc, argv, "v:D:M:a:S:?");