"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/pulsecore/database-gdbm.c" between
pulseaudio-14.0.tar.xz and pulseaudio-14.2.tar.xz

About: PulseAudio is a networked sound server (for POSIX OSes), a proxy for your sound applications.

database-gdbm.c  (pulseaudio-14.0.tar.xz):database-gdbm.c  (pulseaudio-14.2.tar.xz)
skipping to change at line 62 skipping to change at line 62
return to; return to;
} }
void pa_datum_free(pa_datum *d) { void pa_datum_free(pa_datum *d) {
pa_assert(d); pa_assert(d);
free(d->data); /* gdbm uses raw malloc/free hence we should do that here, to o */ free(d->data); /* gdbm uses raw malloc/free hence we should do that here, to o */
pa_zero(d); pa_zero(d);
} }
pa_database* pa_database_open(const char *fn, bool for_write) { const char* pa_database_get_filename_suffix(void) {
return ".gdbm";
}
pa_database* pa_database_open_internal(const char *path, bool for_write) {
GDBM_FILE f; GDBM_FILE f;
int gdbm_cache_size; int gdbm_cache_size;
char *path;
pa_assert(fn); pa_assert(path);
/* We include the host identifier in the file name because gdbm
* files are CPU dependent, and we don't want things to go wrong
* if we are on a multiarch system. */
path = pa_sprintf_malloc("%s."CANONICAL_HOST".gdbm", fn);
errno = 0; errno = 0;
/* We need to set the block size explicitly here, since otherwise /* We need to set the block size explicitly here, since otherwise
* gdbm takes the native block size of the underlying file system * gdbm takes the native block size of the underlying file system
* which might be incredibly large. */ * which might be incredibly large. */
f = gdbm_open((char*) path, 1024, GDBM_NOLOCK | (for_write ? GDBM_WRCREAT : GDBM_READER), 0644, NULL); f = gdbm_open((char*) path, 1024, GDBM_NOLOCK | (for_write ? GDBM_WRCREAT : GDBM_READER), 0644, NULL);
if (f) if (f)
pa_log_debug("Opened GDBM database '%s'", path); pa_log_debug("Opened GDBM database '%s'", path);
pa_xfree(path);
if (!f) { if (!f) {
if (errno == 0) if (errno == 0)
errno = EIO; errno = EIO;
return NULL; return NULL;
} }
/* By default the cache of gdbm is rather large, let's reduce it a bit to sa ve memory */ /* By default the cache of gdbm is rather large, let's reduce it a bit to sa ve memory */
gdbm_cache_size = 10; gdbm_cache_size = 10;
gdbm_setopt(f, GDBM_CACHESIZE, &gdbm_cache_size, sizeof(gdbm_cache_size)); gdbm_setopt(f, GDBM_CACHESIZE, &gdbm_cache_size, sizeof(gdbm_cache_size));
 End of changes. 5 change blocks. 
9 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)