Browse Source

[0.99.35] always ftruncate() POSIX shm registry

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@844 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
joq 21 years ago
parent
commit
17623df33b
2 changed files with 8 additions and 11 deletions
  1. +1
    -1
      configure.ac
  2. +7
    -10
      libjack/shm.c

+ 1
- 1
configure.ac View File

@@ -15,7 +15,7 @@ dnl changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=99
JACK_MICRO_VERSION=34
JACK_MICRO_VERSION=35

dnl ---
dnl HOWTO: updating the jack protocol version


+ 7
- 10
libjack/shm.c View File

@@ -465,13 +465,12 @@ jack_access_registry (jack_shm_info_t *ri)
int shm_fd;
int new_registry = 0;
int rc = -1;
int perm;
int perm = O_RDWR;
jack_shmsize_t size = JACK_SHM_REGISTRY_SIZE;

/* grab a chunk of memory to store shm ids in. this is
to allow clean up of all segments whenever JACK
starts (or stops). */
perm = O_RDWR;
strncpy (registry_id, "/jack-shm-registry", sizeof (registry_id));

/* try without O_CREAT to see if it already exists */
@@ -497,14 +496,12 @@ jack_access_registry (jack_shm_info_t *ri)
}
}

if (perm & O_CREAT) {
if (ftruncate (shm_fd, size) < 0) {
jack_error ("cannot set size of engine shm registry 1"
"(%s)", strerror (errno));
jack_remove_shm (&registry_id);
rc = -2;
goto error;
}
/* force the correct segment size */
if (ftruncate (shm_fd, size) < 0) {
jack_error ("cannot set registry size (%s)", strerror (errno));
jack_remove_shm (&registry_id);
rc = -2;
goto error;
}
if ((ri->attached_at = mmap (0, size, PROT_READ|PROT_WRITE,


Loading…
Cancel
Save