"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "alsactl/init_sysfs.c" between
alsa-utils-1.2.1.tar.bz2 and alsa-utils-1.2.2.tar.bz2

About: ALSA (Advanced Linux Sound Architecture) - Utilities.

init_sysfs.c  (alsa-utils-1.2.1.tar.bz2):init_sysfs.c  (alsa-utils-1.2.2.tar.bz2)
skipping to change at line 36 skipping to change at line 36
char path[PATH_SIZE]; char path[PATH_SIZE];
char *value; /* points to value_local if value is cach ed */ char *value; /* points to value_local if value is cach ed */
char value_local[NAME_SIZE]; char value_local[NAME_SIZE];
}; };
static int sysfs_init(void) static int sysfs_init(void)
{ {
const char *env; const char *env;
char sysfs_test[PATH_SIZE]; char sysfs_test[PATH_SIZE];
INIT_LIST_HEAD(&attr_list);
env = getenv("SYSFS_PATH"); env = getenv("SYSFS_PATH");
if (env) { if (env) {
strlcpy(sysfs_path, env, sizeof(sysfs_path)); strlcpy(sysfs_path, env, sizeof(sysfs_path));
remove_trailing_chars(sysfs_path, '/'); remove_trailing_chars(sysfs_path, '/');
} else } else
strlcpy(sysfs_path, "/sys", sizeof(sysfs_path)); strlcpy(sysfs_path, "/sys", sizeof(sysfs_path));
dbg("sysfs_path='%s'", sysfs_path); dbg("sysfs_path='%s'", sysfs_path);
strlcpy(sysfs_test, sysfs_path, sizeof(sysfs_test)); strlcpy(sysfs_test, sysfs_path, sizeof(sysfs_test));
strlcat(sysfs_test, "/kernel/uevent_helper", sizeof(sysfs_test)); strlcat(sysfs_test, "/kernel/uevent_seqnum", sizeof(sysfs_test));
if (access(sysfs_test, F_OK)) { if (access(sysfs_test, F_OK)) {
error("sysfs path '%s' is invalid\n", sysfs_path); strlcpy(sysfs_test, sysfs_path, sizeof(sysfs_test));
return -errno; strlcat(sysfs_test, "/kernel/uevent_helper", sizeof(sysfs_test));
if (access(sysfs_test, F_OK)) {
error("sysfs path '%s' is invalid", sysfs_path);
return -errno;
}
} }
INIT_LIST_HEAD(&attr_list);
return 0; return 0;
} }
static void sysfs_cleanup(void) static void sysfs_cleanup(void)
{ {
struct sysfs_attr *attr_loop; struct sysfs_attr *attr_loop;
struct sysfs_attr *attr_temp; struct sysfs_attr *attr_temp;
list_for_each_entry_safe(attr_loop, attr_temp, &attr_list, node) { list_for_each_entry_safe(attr_loop, attr_temp, &attr_list, node) {
list_del(&attr_loop->node); list_del(&attr_loop->node);
 End of changes. 4 change blocks. 
4 lines changed or deleted 9 lines changed or added

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