close(fd);
return -1;
} else if ((unsigned int)length != len) {
- dprintf("Could not write %d bytes to attribute %s\n",
+ dprintf("Could not write %zd bytes to attribute %s\n",
len, sysattr->name);
/*
* since we could not write user supplied number of bytes,
SYSFS_PATH_MAX);
safestrcatmax(path, "/", SYSFS_PATH_MAX);
safestrcatmax(path, name, SYSFS_PATH_MAX);
- if (!(sysfs_path_is_file(path)))
+ if (!sysfs_path_is_file(path))
cur = add_attribute((void *)dev, path);
return cur;
}
safestrcpy(file_path, path);
safestrcat(file_path, "/");
safestrcat(file_path, dirent->d_name);
- if ((sysfs_path_is_link(file_path)) == 0) {
+ if (!sysfs_path_is_link(file_path)) {
if (!linklist) {
linklist = dlist_new_with_delete
(SYSFS_NAME_LEN, sysfs_del_name);
safestrcpy(file_path, path);
safestrcat(file_path, "/");
safestrcat(file_path, dirent->d_name);
- if ((sysfs_path_is_dir(file_path)) == 0) {
+ if (!sysfs_path_is_dir(file_path)) {
if (!dirlist) {
dirlist = dlist_new_with_delete
(SYSFS_NAME_LEN, sysfs_del_name);
safestrcpy(file_path, path);
safestrcat(file_path, "/");
safestrcat(file_path, dirent->d_name);
- if ((sysfs_path_is_file(file_path)) == 0) {
+ if (!sysfs_path_is_file(file_path)) {
if (((struct sysfs_device *)dev)->attrlist) {
/* check if attr is already in the list */
attr = (struct sysfs_attribute *)