Received: by mail.netbsd.org (Postfix, from userid 605) id CA2FD84D90; Sun, 23 Feb 2020 18:27:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 52ED684D75 for ; Sun, 23 Feb 2020 18:27:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 7q7XvbsRMB22 for ; Sun, 23 Feb 2020 18:26:59 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 938A284D66 for ; Sun, 23 Feb 2020 18:26:59 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 8D2A7FBF4; Sun, 23 Feb 2020 18:26:59 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1582482419178390" MIME-Version: 1.0 Date: Sun, 23 Feb 2020 18:26:59 +0000 From: "Tobias Nygren" Subject: CVS commit: pkgsrc/x11/libxshmfence/files To: pkgsrc-changes@NetBSD.org Reply-To: tnn@netbsd.org X-Mailer: log_accum Message-Id: <20200223182659.8D2A7FBF4@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1582482419178390 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: tnn Date: Sun Feb 23 18:26:59 UTC 2020 Modified Files: pkgsrc/x11/libxshmfence/files: xshmfence_semaphore.c Log Message: silence format string warning To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 pkgsrc/x11/libxshmfence/files/xshmfence_semaphore.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1582482419178390 Content-Disposition: inline Content-Length: 1409 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/x11/libxshmfence/files/xshmfence_semaphore.c diff -u pkgsrc/x11/libxshmfence/files/xshmfence_semaphore.c:1.6 pkgsrc/x11/libxshmfence/files/xshmfence_semaphore.c:1.7 --- pkgsrc/x11/libxshmfence/files/xshmfence_semaphore.c:1.6 Wed Aug 24 07:16:22 2016 +++ pkgsrc/x11/libxshmfence/files/xshmfence_semaphore.c Sun Feb 23 18:26:59 2020 @@ -159,12 +159,12 @@ xshmfence_init(int fd) __sync_fetch_and_and(&f.triggered, 0); __sync_fetch_and_and(&f.waiting, 0); - lock = mksemtemp(f.lockname, sizeof(f.lockname) - 1, "/xshmfl-%i"); + lock = mksemtemp(f.lockname, sizeof(f.lockname), "l"); if (lock == SEM_FAILED) { err(EXIT_FAILURE, "xshmfence_init: sem_open"); } - cond = mksemtemp(f.condname, sizeof(f.condname) - 1, "/xshmfc-%i"); + cond = mksemtemp(f.condname, sizeof(f.condname), "c"); if (cond == SEM_FAILED) { err(EXIT_FAILURE, "xshmfence_init: sem_open"); } @@ -223,13 +223,14 @@ xshmfence_close_semaphore(struct xshmfen } static sem_t * -mksemtemp(char *name, size_t namelen, const char *template) +mksemtemp(char *name, size_t namelen, const char *suffix) { sem_t *ret; pid_t p; p = getpid(); for(;;) { - snprintf(name, namelen, template, p); + if (snprintf(name, namelen, "/xshmf%s-%d", suffix, p) >= namelen) + return SEM_FAILED; ret = sem_open(name, O_CREAT|O_EXCL, 0600, 1); if (ret == SEM_FAILED) { if (errno == EEXIST) { --_----------=_1582482419178390--