[gst-cvs] gst-plugins-bad: shmpipe: Don't pretend the path is random

Olivier Crête tester at kemper.freedesktop.org
Thu Jun 3 12:28:16 PDT 2010


Module: gst-plugins-bad
Branch: master
Commit: 73fa2f9b7600e1bb5aa5270f65efddff900789b9
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=73fa2f9b7600e1bb5aa5270f65efddff900789b9

Author: Olivier Crête <olivier.crete at collabora.co.uk>
Date:   Fri Jan 29 11:06:44 2010 +0200

shmpipe: Don't pretend the path is random

---

 gst/shm/shmpipe.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gst/shm/shmpipe.c b/gst/shm/shmpipe.c
index b4b28ca..6f4a867 100644
--- a/gst/shm/shmpipe.c
+++ b/gst/shm/shmpipe.c
@@ -225,6 +225,7 @@ sp_open_shm (char *path, int id, int writer, mode_t perms, size_t size)
   char tmppath[PATH_MAX];
   int flags;
   int prot;
+  int i = 0;
 
   memset (area, 0, sizeof (ShmArea));
 
@@ -244,8 +245,7 @@ sp_open_shm (char *path, int id, int writer, mode_t perms, size_t size)
     area->shm_fd = shm_open (path, flags, perms);
   } else {
     do {
-      snprintf (tmppath, PATH_MAX, "/%X%X%X%X%X.shmpipe",
-          rand (), rand (), rand (), rand (), rand ());
+      snprintf (tmppath, PATH_MAX, "/shmpipe.5%d.%5d", getpid (), i++);
       area->shm_fd = shm_open (tmppath, flags, perms);
     } while (area->shm_fd < 0 && errno == EEXIST);
   }





More information about the Gstreamer-commits mailing list