Mesa (master): mesa: stop trying new filenames if the filename existing is not the issue

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 28 22:47:35 UTC 2019


Module: Mesa
Branch: master
Commit: 78aa4a3c0a93fad835c453046343f8a7b313d20d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=78aa4a3c0a93fad835c453046343f8a7b313d20d

Author: Eric Engestrom <eric.engestrom at intel.com>
Date:   Sat Jun 22 13:49:02 2019 +0100

mesa: stop trying new filenames if the filename existing is not the issue

Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/main/shaderapi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index f23e9c00be5..e06ab00bb0b 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -37,6 +37,7 @@
  */
 
 
+#include <errno.h>
 #include <stdbool.h>
 #include <c99_alloca.h>
 #include "main/glheader.h"
@@ -1255,6 +1256,11 @@ link_program(struct gl_context *ctx, struct gl_shader_program *shProg,
          file = os_file_create_unique(filename, 0644);
          if (file)
             break;
+         /* If we are failing for another reason than "this filename already
+          * exists", we are likely to fail again with another filename, so
+          * let's just give up */
+         if (errno != EEXIST)
+            break;
          ralloc_free(filename);
       }
       if (file) {




More information about the mesa-commit mailing list