summaryrefslogtreecommitdiffstats
path: root/src/sound-theme-spec.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-05-27 10:53:55 +0000
committerLennart Poettering <lennart@poettering.net>2008-05-27 10:53:55 +0000
commit7ac8038c3690eb5547cfdff83235f3636f87c303 (patch)
tree0854e5d007b5142095b57d0e00fd7aaaba17fc5e /src/sound-theme-spec.c
parent6a75b780762a8695a83e0e94e6fcbce4d2f73573 (diff)
add acx_pthread to the build
git-svn-id: file:///home/lennart/svn/public/libcanberra/trunk@14 01b60673-d06a-42c0-afdd-89cb8e0f78ac
Diffstat (limited to 'src/sound-theme-spec.c')
-rw-r--r--src/sound-theme-spec.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/sound-theme-spec.c b/src/sound-theme-spec.c
index 11f15d8..274fe26 100644
--- a/src/sound-theme-spec.c
+++ b/src/sound-theme-spec.c
@@ -24,7 +24,10 @@
#include <config.h>
#endif
+#include <errno.h>
+
#include "sound-theme-spec.h"
+#include "malloc.h"
#include "llist.h"
#define DEFAULT_THEME "freedesktop"
@@ -45,7 +48,7 @@ struct ca_theme_data {
char *name;
CA_LLIST_HEAD(ca_data_dir, data_dirs);
- ca_theme_dir *last_dir;
+ ca_data_dir *last_dir;
unsigned n_theme_dir;
ca_bool_t loaded_fallback_theme;
@@ -76,11 +79,11 @@ static int get_data_home(char **e) {
static ca_bool_t data_dir_matches(ca_data_dir *d, const char*output_profile) {
ca_assert(d);
- ca_assert(profile);
+ ca_assert(output_profile);
/* We might want to add more elaborate matching here eventually */
- return streq(d->profile, output_profile);
+ return streq(d->output_profile, output_profile);
}
static ca_data_dir* find_data_dir(ca_theme_data *t, const char *name) {
@@ -103,7 +106,7 @@ static int add_data_dir(ca_theme_data *t, const char *name) {
ca_return_val_if_fail(name, CA_ERROR_INVALID);
if (find_data_dir(t, name))
- return;
+ return CA_SUCCESS;
if (!(d = ca_new0(ca_data_dir, 1)))
return CA_ERROR_OOM;
@@ -146,7 +149,7 @@ static int load_theme_path(ca_theme_data *t, const char *prefix, const char *nam
for (;;) {
char ln[1024];
- if (!(fgets(ln, f))) {
+ if (!(fgets(ln, sizeof(ln), f))) {
if (feof(f))
break;