direntp->d_name);
continue;
}
- if ((st.st_mode & S_IWGRP) & !zcp->do_force) {
+ if ((st.st_mode & S_IWGRP) && !zcp->do_force) {
zed_log_msg(LOG_NOTICE,
"Ignoring \"%s\": writable by group",
direntp->d_name);
continue;
}
- if ((st.st_mode & S_IWOTH) & !zcp->do_force) {
+ if ((st.st_mode & S_IWOTH) && !zcp->do_force) {
zed_log_msg(LOG_NOTICE,
"Ignoring \"%s\": writable by other",
direntp->d_name);
/*
* Write PID file.
*/
- n = snprintf(buf, sizeof (buf), "%d\n", (int) getpid());
+ n = snprintf(buf, sizeof (buf), "%d\n", (int)getpid());
if ((n < 0) || (n >= sizeof (buf))) {
errno = ERANGE;
zed_log_msg(LOG_ERR, "Failed to write PID file \"%s\": %s",
"Failed to read state file: %s", strerror(errno));
return (-1);
}
- if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t) -1) {
+ if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t)-1) {
zed_log_msg(LOG_WARNING,
"Failed to reposition state file offset: %s",
strerror(errno));
"Failed to write state file: %s", strerror(errno));
return (-1);
}
- if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t) -1) {
+ if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t)-1) {
zed_log_msg(LOG_WARNING,
"Failed to reposition state file offset: %s",
strerror(errno));