[arch-commits] Commit in mesa/trunk (get-program-name-based-on-path.patch)

Evangelos Foutras foutrelis at archlinux.org
Tue Mar 26 02:06:54 UTC 2019


    Date: Tuesday, March 26, 2019 @ 02:06:53
  Author: foutrelis
Revision: 349206

Remove obsolete patch

Deleted:
  mesa/trunk/get-program-name-based-on-path.patch

--------------------------------------+
 get-program-name-based-on-path.patch |   58 ---------------------------------
 1 file changed, 58 deletions(-)

Deleted: get-program-name-based-on-path.patch
===================================================================
--- get-program-name-based-on-path.patch	2019-03-26 02:05:44 UTC (rev 349205)
+++ get-program-name-based-on-path.patch	2019-03-26 02:06:53 UTC (rev 349206)
@@ -1,58 +0,0 @@
-From 759b94038987bb983398cd4b1d2cb1c8f79817a9 Mon Sep 17 00:00:00 2001
-From: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
-Date: Tue, 23 Oct 2018 11:38:48 -0400
-Subject: [PATCH] util: Get program name based on path when possible
-
-Some programs start with the path and command line arguments in
-argv[0] (program_invocation_name). Chromium is an example of
-an application using mesa that does this.
-
-This tries to query the real path for the symbolic link /proc/self/exe
-to find the program name instead. It only uses the realpath if it
-was a prefix of the invocation to avoid breaking wine programs.
-
-Cc: Timothy Arceri <tarceri at itsqueeze.com>
-Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
-Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
----
- src/util/u_process.c | 23 ++++++++++++++++++++++-
- 1 file changed, 22 insertions(+), 1 deletion(-)
-
-diff --git a/src/util/u_process.c b/src/util/u_process.c
-index 5e5927678d8..a1667e78074 100644
---- a/src/util/u_process.c
-+++ b/src/util/u_process.c
-@@ -41,8 +41,29 @@ static const char *
- __getProgramName()
- {
-    char * arg = strrchr(program_invocation_name, '/');
--   if (arg)
-+   if (arg) {
-+      /* If the / character was found this is likely a linux path or
-+       * an invocation path for a 64-bit wine program.
-+       *
-+       * However, some programs pass command line arguments into argv[0].
-+       * Strip these arguments out by using the realpath only if it was
-+       * a prefix of the invocation name.
-+       */
-+      static char *path;
-+
-+      if (!path)
-+         path = realpath("/proc/self/exe", NULL);
-+
-+      if (path && strncmp(path, program_invocation_name, strlen(path)) == 0) {
-+         /* This shouldn't be null because path is a a prefix,
-+          * but check it anyway since path is static. */
-+         char * name = strrchr(path, '/');
-+         if (name)
-+            return name + 1;
-+      }
-+
-       return arg+1;
-+   }
- 
-    /* If there was no '/' at all we likely have a windows like path from
-     * a wine application.
--- 
-2.18.1
-



More information about the arch-commits mailing list