diff --git a/configure.ac b/configure.ac index 5ee5a04..9c7c47f 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,9 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET +# Checks for operating system services and capabilities. +AC_SYS_LARGEFILE + # Checks for header files. AC_HEADER_DIRENT AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h unistd.h]) diff --git a/lib/sysfs_attr.c b/lib/sysfs_attr.c index ccf829f..8d2d0fc 100644 --- a/lib/sysfs_attr.c +++ b/lib/sysfs_attr.c @@ -179,6 +179,7 @@ int sysfs_read_attribute(struct sysfs_attribute *sysattr) return 0; } free(sysattr->value); + sysattr->value = NULL; } sysattr->len = length; close(fd); @@ -255,7 +256,7 @@ int sysfs_write_attribute(struct sysfs_attribute *sysattr, * restore the old value if one available */ if (sysattr->method & SYSFS_METHOD_SHOW) { - length = write(fd, sysattr->value, sysattr->len); + (void)write(fd, sysattr->value, sysattr->len); close(fd); return -1; } @@ -629,7 +630,7 @@ struct dlist *get_dev_attributes_list(void *dev) else add_attribute(dev, file_path); } else - attr = add_attribute(dev, file_path); + add_attribute(dev, file_path); } } closedir(dir); diff --git a/test/dlist_test.c b/test/dlist_test.c index e7f3d1e..a5365b6 100644 --- a/test/dlist_test.c +++ b/test/dlist_test.c @@ -68,7 +68,8 @@ int main (void) Dlist *list; Simple *s1,*s2,*s3,*stemp; Complex *c1,*c2,*c3, *c4, *ctemp, *cfound; - while(1) + int count = 10; + while(count--) { s1=simple_maker(1,"one"); s2=simple_maker(2,"two");