"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/pulsecore/database-simple.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-simple.c  (pulseaudio-14.0.tar.xz):database-simple.c  (pulseaudio-14.2.tar.xz)
skipping to change at line 225 skipping to change at line 225
pa_log_warn("read error. %s", pa_cstrerror(errno)); pa_log_warn("read error. %s", pa_cstrerror(errno));
pa_database_clear((pa_database*)db); pa_database_clear((pa_database*)db);
} }
if (field == FIELD_DATA && d) if (field == FIELD_DATA && d)
pa_xfree(d); pa_xfree(d);
return pa_hashmap_size(db->map); return pa_hashmap_size(db->map);
} }
pa_database* pa_database_open(const char *fn, bool for_write) { const char* pa_database_get_filename_suffix(void) {
return ".simple";
}
pa_database* pa_database_open_internal(const char *path, bool for_write) {
FILE *f; FILE *f;
char *path;
simple_data *db; simple_data *db;
pa_assert(fn); pa_assert(path);
path = pa_sprintf_malloc("%s."CANONICAL_HOST".simple", fn);
errno = 0; errno = 0;
f = pa_fopen_cloexec(path, "r"); f = pa_fopen_cloexec(path, "r");
if (f || errno == ENOENT) { /* file not found is ok */ if (f || errno == ENOENT) { /* file not found is ok */
db = pa_xnew0(simple_data, 1); db = pa_xnew0(simple_data, 1);
db->map = pa_hashmap_new_full(hash_func, compare_func, NULL, (pa_free_cb _t) free_entry); db->map = pa_hashmap_new_full(hash_func, compare_func, NULL, (pa_free_cb _t) free_entry);
db->filename = pa_xstrdup(path); db->filename = pa_xstrdup(path);
db->tmp_filename = pa_sprintf_malloc(".%s.tmp", db->filename); db->tmp_filename = pa_sprintf_malloc(".%s.tmp", db->filename);
db->read_only = !for_write; db->read_only = !for_write;
skipping to change at line 254 skipping to change at line 256
if (f) { if (f) {
fill_data(db, f); fill_data(db, f);
fclose(f); fclose(f);
} }
} else { } else {
if (errno == 0) if (errno == 0)
errno = EIO; errno = EIO;
db = NULL; db = NULL;
} }
pa_xfree(path);
return (pa_database*) db; return (pa_database*) db;
} }
void pa_database_close(pa_database *database) { void pa_database_close(pa_database *database) {
simple_data *db = (simple_data*)database; simple_data *db = (simple_data*)database;
pa_assert(db); pa_assert(db);
pa_database_sync(database); pa_database_sync(database);
pa_xfree(db->filename); pa_xfree(db->filename);
pa_xfree(db->tmp_filename); pa_xfree(db->tmp_filename);
 End of changes. 5 change blocks. 
6 lines changed or deleted 6 lines changed or added

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