diff options
Diffstat (limited to 'src/pulsecore/shm.c')
-rw-r--r-- | src/pulsecore/shm.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c index a1bbf609..a6843819 100644 --- a/src/pulsecore/shm.c +++ b/src/pulsecore/shm.c @@ -57,7 +57,7 @@ #define MADV_REMOVE 9 #endif -#define MAX_SHM_SIZE (PA_ALIGN(1024*1024*20)) +#define MAX_SHM_SIZE (PA_ALIGN(1024*1024*64)) #ifdef __linux__ /* On Linux we know that the shared memory blocks are files in @@ -86,13 +86,13 @@ static char *segment_name(char *fn, size_t l, unsigned id) { return fn; } -int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) { +int pa_shm_create_rw(pa_shm *m, size_t size, pa_bool_t shared, mode_t mode) { char fn[32]; int fd = -1; pa_assert(m); pa_assert(size > 0); - pa_assert(size < MAX_SHM_SIZE); + pa_assert(size <= MAX_SHM_SIZE); pa_assert(mode >= 0600); /* Each time we create a new SHM area, let's first drop all stale @@ -124,7 +124,7 @@ int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) { m->ptr = pa_xmalloc(m->size); #endif - m->do_unlink = 0; + m->do_unlink = FALSE; } else { #ifdef HAVE_SHM_OPEN @@ -157,7 +157,7 @@ int pa_shm_create_rw(pa_shm *m, size_t size, int shared, mode_t mode) { pa_atomic_store(&marker->marker, SHM_MARKER); pa_assert_se(close(fd) == 0); - m->do_unlink = 1; + m->do_unlink = TRUE; #else return -1; #endif @@ -375,7 +375,7 @@ int pa_shm_cleanup(void) { /* Ok, the owner of this shms segment is dead, so, let's remove the segment */ segment_name(fn, sizeof(fn), id); - if (shm_unlink(fn) < 0 && errno != EACCES) + if (shm_unlink(fn) < 0 && errno != EACCES && errno != ENOENT) pa_log_warn("Failed to remove SHM segment %s: %s\n", fn, pa_cstrerror(errno)); } |