Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and code cleanups #27

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
5 changes: 3 additions & 2 deletions lib/sysfs_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion test/dlist_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down