+2008-05-25 Nicolas François <nicolas.francois@centraliens.net>
+
+ * libmisc/chowndir.c: Avoid assignment in comparisons, implicit
+ comparison of integers to booleans.
+ * libmisc/chowndir.c: The return value of closedir is not checked
+ on purpose.
+ * libmisc/chowndir.c: Add brackets.
+
2008-05-25 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/chkname.h, libmisc/chkname.c: check_group_name (resp.
* Do the entire subdirectory.
*/
- if ((rc = chown_tree (new_name, old_uid, new_uid,
- old_gid, new_gid)))
+ rc = chown_tree (new_name, old_uid, new_uid,
+ old_gid, new_gid);
+ if (0 != rc) {
break;
+ }
}
#ifndef HAVE_LCHOWN
/* don't use chown (follows symbolic links!) */
LCHOWN (new_name, new_uid,
sb.st_gid == old_gid ? new_gid : sb.st_gid);
}
- closedir (dir);
+ (void) closedir (dir);
/*
* Now do the root of the tree
*/
- if (!stat (root, &sb)) {
- if (sb.st_uid == old_uid)
+ if (stat (root, &sb) == 0) {
+ if (sb.st_uid == old_uid) {
LCHOWN (root, new_uid,
- sb.st_gid == old_gid ? new_gid : sb.st_gid);
+ sb.st_gid == old_gid ? new_gid : sb.st_gid);
+ }
}
return rc;
}
+