summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-05-16 05:11:18 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-05-16 05:11:18 +0000
commitbeac9fc3504e23f8fccd9aaa9b1a075ded9507f5 (patch)
tree4734255ee7d561b1b7857a7b89ae466b356590db
parent259a9356de14a22c0a2633a06bb64f18e00ef728 (diff)
downloadevas_generic_loaders-beac9fc3504e23f8fccd9aaa9b1a075ded9507f5.tar.gz
hmmm shmfile didnt point to the same place. thats odd. make it malloced.
SVN revision: 59436
-rw-r--r--src/bin/common/shmfile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/common/shmfile.c b/src/bin/common/shmfile.c
index 7af1f75..85e76d9 100644
--- a/src/bin/common/shmfile.c
+++ b/src/bin/common/shmfile.c
@@ -22,16 +22,18 @@ extern "C" {
int shm_fd = -1;
int shm_size = 0;
void *shm_addr = NULL;
-char shmfile[1024] = "";
+char *shmfile = NULL;
void
shm_alloc(int dsize)
{
#ifdef HAVE_SHM_OPEN
+ if (!shmfile) shmfile = malloc(1024);
+ shmfile[0] = 0;
srand(time(NULL));
do
{
- snprintf(shmfile, sizeof(shmfile), "/evas-loader-xcf.%i.%i",
+ snprintf(shmfile, sizeof(shmfile), "/evas-loader.%i.%i",
(int)getpid(), (int)rand());
shm_fd = shm_open(shmfile, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
}
@@ -69,6 +71,8 @@ shm_free(void)
close(shm_fd);
shm_fd = -1;
shm_addr = NULL;
+ if (shmfile) free(shmfile);
+ shmfile = NULL;
return;
}
#endif