From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Q03xM-0005h1-JM for garchives@archives.gentoo.org; Thu, 17 Mar 2011 03:33:01 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A1A071C063; Thu, 17 Mar 2011 03:32:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 760681C063 for ; Thu, 17 Mar 2011 03:32:53 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BCE811B4012 for ; Thu, 17 Mar 2011 03:32:52 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 559) id 6D15420051; Thu, 17 Mar 2011 03:32:51 +0000 (UTC) From: "Mike Frysinger (vapier)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, vapier@gentoo.org Subject: [gentoo-commits] gentoo-projects commit in portage-utils: q.c X-VCS-Repository: gentoo-projects X-VCS-Files: q.c X-VCS-Directories: portage-utils X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger Content-Type: text/plain; charset=utf8 Message-Id: <20110317033251.6D15420051@flycatcher.gentoo.org> Date: Thu, 17 Mar 2011 03:32:51 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 8c2a56f85553cedc5cb2cc05827d3605 vapier 11/03/17 03:32:51 Modified: q.c Log: fix `q --install` behavior ... new code was incorrectly linking to the = dir due to dirname() modifying the buffer Revision Changes Path 1.52 portage-utils/q.c file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils= /q.c?rev=3D1.52&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils= /q.c?rev=3D1.52&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils= /q.c?r1=3D1.51&r2=3D1.52 Index: q.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-projects/portage-utils/q.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- q.c 1 Mar 2011 04:20:19 -0000 1.51 +++ q.c 17 Mar 2011 03:32:51 -0000 1.52 @@ -1,7 +1,7 @@ /* * Copyright 2005-2010 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/q.c,v 1.51 2011/0= 3/01 04:20:19 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/q.c,v 1.52 2011/0= 3/17 03:32:51 vapier Exp $ * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2010 Mike Frysinger - @@ -22,7 +22,7 @@ "Module path", COMMON_OPTS_HELP }; -static const char q_rcsid[] =3D "$Id: q.c,v 1.51 2011/03/01 04:20:19 vap= ier Exp $"; +static const char q_rcsid[] =3D "$Id: q.c,v 1.52 2011/03/17 03:32:51 vap= ier Exp $"; #define q_usage(ret) usage(ret, Q_FLAGS, q_long_opts, q_opts_help, looku= p_applet_idx("q")) =20 static APPLET lookup_applet(const char *applet) @@ -97,6 +97,7 @@ =20 if (install) { char buf[_Q_PATH_MAX]; + const char *prog; ssize_t rret; int fd, ret; =20 @@ -115,6 +116,7 @@ } else buf[rret] =3D '\0'; =20 + prog =3D basename(buf); fd =3D open(dirname(buf), O_RDONLY|O_CLOEXEC); if (fd < 0) { warnfp("chdir(%s) failed", buf); @@ -123,7 +125,7 @@ =20 ret =3D 0; for (i =3D 1; applets[i].desc; ++i) { - int r =3D symlinkat(buf, fd, applets[i].name); + int r =3D symlinkat(prog, fd, applets[i].name); if (!quiet) printf(" %s ...\t[%s]\n", applets[i].name, r ? strerror(errno) : "OK= "); if (r && errno !=3D EEXIST)