for (inst2 = instance_list; inst2; inst2 = inst2->next) {
if (inst2->flags & FLAG_DONE)
continue;
- if (strcmp(inst2->type, "ext2") &&
+ if (strcmp(inst2->type, "ext2") != 0 &&
strcmp(inst2->type, "ext3") &&
- strcmp(inst2->type, "ext4") &&
- strcmp(inst2->type, "ext4dev"))
+ strcmp(inst2->type, "ext4") != 0 &&
+ strcmp(inst2->type, "ext4dev") != 0)
continue;
/*
* If we've just started the fsck, wait a tiny
if (type && strcmp(type, "auto") != 0)
;
- else if (fstype && strncmp(fstype, "no", 2) &&
- strncmp(fstype, "opts=", 5) && strncmp(fstype, "loop", 4) &&
+ else if (fstype && strncmp(fstype, "no", 2) != 0 &&
+ strncmp(fstype, "opts=", 5) != 0 && strncmp(fstype, "loop", 4) != 0 &&
!strchr(fstype, ','))
type = fstype;
else
inode = get_inode(ino);
name_depth--;
if (!offset) {
- if (!inode || strcmp(".", name)) {
+ if (!inode || strcmp(".", name) != 0) {
get_current_name();
printf(_("%s: bad directory: '.' isn't first\n"),
current_name);
return;
}
if (offset == dirsize) {
- if (!inode || strcmp("..", name)) {
+ if (!inode || strcmp("..", name) != 0) {
get_current_name();
printf(_("%s: bad directory: '..' isn't second\n"),
current_name);
inode = get_inode2(ino);
name_depth--;
if (!offset) {
- if (!inode || strcmp(".", name)) {
+ if (!inode || strcmp(".", name) != 0) {
get_current_name();
printf(_("%s: bad directory: '.' isn't first\n"),
current_name);
return;
}
if (offset == dirsize) {
- if (!inode || strcmp("..", name)) {
+ if (!inode || strcmp("..", name) != 0) {
get_current_name();
printf(_("%s: bad directory: '..' isn't second\n"),
current_name);
if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN)
continue;
#endif
- if (strncmp(parent, d->d_name, strlen(parent)))
+ if (strncmp(parent, d->d_name, strlen(parent)) != 0)
continue;
snprintf(path, sizeof(path), "%s/partition", d->d_name);
/* Skip the first line */
if (!fgets(buf, sizeof(buf), f))
goto leave;
- if (*buf && strncmp(buf, "Filename\t", 9))
+ if (*buf && strncmp(buf, "Filename\t", 9) != 0)
/* Linux <=2.6.19 contained a bug in the /proc/swaps
* code where the header would not be displayed
*/
while(loopcxt_next(&lc) == 0) {
char *backing = loopcxt_get_backing_file(&lc);
- if (!backing || strcmp(backing, filename)) {
+ if (!backing || strcmp(backing, filename) != 0) {
free(backing);
continue;
}
/* Only the SWAPSPACE2 is supported. */
if (blkid_probe_lookup_value(pr, "VERSION", &version, NULL) == 0
&& version
- && strcmp(version, stringify_value(SWAP_VERSION)))
+ && strcmp(version, stringify_value(SWAP_VERSION)) != 0)
warnx(_("%s: unsupported swap version '%s'"),
devname, version);
else
goto done;
sysfs_devname_dev_to_sys(_name);
- if (parent && strncmp("dm-", name, 3)) {
+ if (parent && strncmp("dm-", name, 3) != 0) {
/*
* Create path to /sys/block/<parent>/<name>/dev
*/
/* search by name */
list_for_each(p, &cache->bic_devs) {
tmp = list_entry(p, struct blkid_struct_dev, bid_devs);
- if (strcmp(tmp->bid_name, devname))
+ if (strcmp(tmp->bid_name, devname) != 0)
continue;
dev = tmp;
break;
DBG(DEVNAME, ul_debug("search canonical %s", cn));
list_for_each(p, &cache->bic_devs) {
tmp = list_entry(p, struct blkid_struct_dev, bid_devs);
- if (strcmp(tmp->bid_name, cn))
+ if (strcmp(tmp->bid_name, cn) != 0)
continue;
dev = tmp;
if (dev2->bid_flags & BLKID_BID_FL_VERIFIED)
continue;
if (!dev->bid_type || !dev2->bid_type ||
- strcmp(dev->bid_type, dev2->bid_type))
+ strcmp(dev->bid_type, dev2->bid_type) != 0)
continue;
if (dev->bid_label && dev2->bid_label &&
- strcmp(dev->bid_label, dev2->bid_label))
+ strcmp(dev->bid_label, dev2->bid_label) != 0)
continue;
if (dev->bid_uuid && dev2->bid_uuid &&
- strcmp(dev->bid_uuid, dev2->bid_uuid))
+ strcmp(dev->bid_uuid, dev2->bid_uuid) != 0)
continue;
if ((dev->bid_label && !dev2->bid_label) ||
(!dev->bid_label && dev2->bid_label) ||
while ((de = readdir(dir)) != NULL) {
if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..") ||
!strcmp(de->d_name, devname) ||
- strncmp(de->d_name, "dm-", 3) ||
+ strncmp(de->d_name, "dm-", 3) != 0 ||
strlen(de->d_name) > sizeof(path)-32)
continue;
sprintf(path, "/sys/block/%s/slaves", de->d_name);
* dev, and the device's base name has changed,
* check last as well.
*/
- if (lens[last] && strncmp(ptnames[last], ptname, lens[last])) {
+ if (lens[last] && strncmp(ptnames[last], ptname, lens[last]) != 0) {
DBG(DEVNAME, ul_debug(" whole dev %s, devno 0x%04X",
ptnames[last], (unsigned int) devs[last]));
probe_one(cache, ptnames[last], devs[last], 0,
if (!IS_ACTIVE(xrs->part[i+1]))
break;
- if (memcmp(xrs->part[i+1].id, "XGM", 3))
+ if (memcmp(xrs->part[i+1].id, "XGM", 3) != 0)
return 0;
xstart = x0start + be32_to_cpu(xrs->part[i+1].start);
if (!buf_mft)
return errno ? -errno : 1;
- if (memcmp(buf_mft, "FILE", 4))
+ if (memcmp(buf_mft, "FILE", 4) != 0)
return 1;
off += MFT_RECORD_VOLUME * mft_record_size;
if (!buf_mft)
return errno ? -errno : 1;
- if (memcmp(buf_mft, "FILE", 4))
+ if (memcmp(buf_mft, "FILE", 4) != 0)
return 1;
/* return if caller does not care about UUID and LABEL */
}
}
- if (boot_label && memcmp(boot_label, no_name, 11))
+ if (boot_label && memcmp(boot_label, no_name, 11) != 0)
blkid_probe_set_id_label(pr, "LABEL_FATBOOT", boot_label, 11);
if (vol_label)
tag = blkid_find_tag_dev(dev, type);
if (!value)
return (tag != NULL);
- if (!tag || strcmp(tag->bit_val, value))
+ if (!tag || strcmp(tag->bit_val, value) != 0)
return 0;
return 1;
}
}
if (strncmp(name, (char *) sgilabel->boot_file,
- sizeof(sgilabel->boot_file))) {
+ sizeof(sgilabel->boot_file)) != 0) {
fdisk_warnx(cxt, _("Be aware that the bootfile is not checked "
"for existence. SGI's default is \"/unix\", "
"and for backup \"/unix.save\"."));
* Source is PATH (canonicalize)
*/
path = mnt_resolve_path(src, cache);
- if (path && strcmp(path, src))
+ if (path && strcmp(path, src) != 0)
rc = mnt_fs_set_source(cxt->fs, path);
}
int flags = 0;
/* check if it begins with /dev/loop */
- if (strncmp(devname, _PATH_DEV_LOOP, sizeof(_PATH_DEV_LOOP) - 1))
+ if (strncmp(devname, _PATH_DEV_LOOP, sizeof(_PATH_DEV_LOOP) - 1) != 0)
return 0;
src = mnt_fs_get_srcpath(fs);
}
continue;
}
- if (strncmp(ent->name, name, namelen))
+ if (strncmp(ent->name, name, namelen) != 0)
continue;
p = ent->name + namelen;
if (*p == '\0' || *p == '=' || *p == '[') {
if (!username)
return -ENOMEM;
- if (!ol.valsz || (ol.value && strncmp(ol.value, username, ol.valsz))) {
+ if (!ol.valsz || (ol.value && strncmp(ol.value, username, ol.valsz) != 0)) {
if (ol.valsz)
/* remove old value */
mnt_optstr_remove_option_at(optstr, ol.value, ol.end);
*f1 = mnt_fs_get_fs_options(o_fs),
*f2 = mnt_fs_get_fs_options(fs);
- if ((v1 && v2 && strcmp(v1, v2)) || (f1 && f2 && strcmp(f1, f2)))
+ if ((v1 && v2 && strcmp(v1, v2) != 0) || (f1 && f2 && strcmp(f1, f2) != 0))
tabdiff_add_entry(df, o_fs, fs, MNT_TABDIFF_REMOUNT);
}
}
namesz = strlen(d->d_name);
if (!namesz || namesz < MNT_MNTTABDIR_EXTSIZ + 1 ||
strcmp(d->d_name + (namesz - MNT_MNTTABDIR_EXTSIZ),
- MNT_MNTTABDIR_EXT))
+ MNT_MNTTABDIR_EXT) != 0)
return 0;
/* Accept this */
*/
if (!cxt->tty_path || !*cxt->tty_path ||
lstat(cxt->tty_path, &st) != 0 || !S_ISCHR(st.st_mode) ||
- (st.st_nlink > 1 && strncmp(cxt->tty_path, "/dev/", 5)) ||
+ (st.st_nlink > 1 && strncmp(cxt->tty_path, "/dev/", 5) != 0) ||
access(cxt->tty_path, R_OK | W_OK) != 0) {
syslog(LOG_ERR, _("FATAL: bad tty"));
shell = getenv("SHELL");
if (shell
- && strcmp(shell, su->pwd->pw_shell)
+ && strcmp(shell, su->pwd->pw_shell) != 0
&& getuid() != 0
&& is_restricted_shell(su->pwd->pw_shell)) {
/* The user being su'd to has a nonstandard shell, and
if (spec && (flags & FL_EVALUATE))
spec = cn = mnt_resolve_spec(spec, cache);
}
- if (root && spec && !(flags & FL_NOFSROOT) && strcmp(root, "/"))
+ if (root && spec && !(flags & FL_NOFSROOT) && strcmp(root, "/") != 0)
xasprintf(&str, "%s[%s]", spec, root);
else if (spec)
str = xstrdup(spec);
close(fd2);
return;
}
- if (memcmp(ctl->iobuf1, ctl->iobuf2, rsize))
+ if (memcmp(ctl->iobuf1, ctl->iobuf2, rsize) != 0)
break;
}
close(fd2);
return 0;
len = strlen(pattern);
- if (strncmp(buf, pattern, len))
+ if (strncmp(buf, pattern, len) != 0)
return 0;
p = buf + len;
zn = zone_names[zone_id];
if (enable && !strcasestr(line, zn))
continue;
- if (!enable && strncasecmp(line, zn, strlen(zn)))
+ if (!enable && strncasecmp(line, zn, strlen(zn)) != 0)
continue;
} else if (enable) {
/* By default, use zone Movable for online, if valid */
warnx(_("%s enable failed: Zone mismatch"), str);
continue;
}
- if (!enable && strncasecmp(line, zn, strlen(zn))) {
+ if (!enable && strncasecmp(line, zn, strlen(zn)) != 0) {
warnx(_("%s disable failed: Zone mismatch"), str);
continue;
}
static int filter(const struct dirent *de)
{
- if (strncmp("memory", de->d_name, 6))
+ if (strncmp("memory", de->d_name, 6) != 0)
return 0;
return isdigit_string(de->d_name + 6);
}
if (desc->vendor == NULL || desc->model == NULL)
return;
- if ((strncmp(desc->vendor,"0x",2) || strncmp(desc->model,"0x",2) ))
+ if ((strncmp(desc->vendor,"0x",2) != 0 || strncmp(desc->model,"0x",2) ))
return;
errno = 0;
return 0;
/* pattern */
- if (strncmp(line, pattern, len))
+ if (strncmp(line, pattern, len) != 0)
return 0;
/* white spaces */
int level;
/* Make sure line starts with "cache<nr> :" */
- if (strncmp(line, "cache", 5))
+ if (strncmp(line, "cache", 5) != 0)
return 0;
for (p = line + 5; isdigit(*p); p++);
for (; isspace(*p); p++);
node = -1;
while ((de = readdir(dir)) != NULL) {
- if (strncmp("node", de->d_name, 4))
+ if (strncmp("node", de->d_name, 4) != 0)
continue;
if (!isdigit_string(de->d_name + 4))
continue;
static int memory_block_filter(const struct dirent *de)
{
- if (strncmp("memory", de->d_name, 6))
+ if (strncmp("memory", de->d_name, 6) != 0)
return 0;
return isdigit_string(de->d_name + 6);
}
return;
uname(&un);
- if (strcmp(un.machine, dom->result_arch)) {
- if (strcmp(dom->result_arch, "i386")
- || (strcmp(un.machine, "i486")
+ if (strcmp(un.machine, dom->result_arch) != 0) {
+ if (strcmp(dom->result_arch, "i386") != 0
+ || (strcmp(un.machine, "i486") != 0
&& strcmp(un.machine, "i586")
- && strcmp(un.machine, "i686")
- && strcmp(un.machine, "athlon")))
+ && strcmp(un.machine, "i686") != 0
+ && strcmp(un.machine, "athlon") != 0))
errx(EXIT_FAILURE, _("Kernel cannot set architecture to %s"), wanted);
}
}
size_t sz;
char *tp, *old = entry;
- if (memcmp(p, "\\u", 2)) {
+ if (memcmp(p, "\\u", 2) != 0) {
p++;
continue; /* no \u */
}
namesz = strlen(d->d_name);
if (!namesz || namesz < ISSUEDIR_EXTSIZ + 1 ||
- strcmp(d->d_name + (namesz - ISSUEDIR_EXTSIZ), ISSUEDIR_EXT))
+ strcmp(d->d_name + (namesz - ISSUEDIR_EXTSIZ), ISSUEDIR_EXT) != 0)
return 0;
/* Accept this */
tm = localtime(&now);
/* print greeting */
printf("\r\n\a\a\a");
- if (strcmp(login, pwuid))
+ if (strcmp(login, pwuid) != 0)
printf(_("Message from %s@%s (as %s) on %s at %02d:%02d ..."),
login, host, pwuid, ctl->src_tty_name,
tm->tm_hour, tm->tm_min);
}
for (i = 0; i < sizeof(errors)/sizeof(*errors); i++) {
- if (strcmp(errors[i].str, argv[1]))
+ if (strcmp(errors[i].str, argv[1]) != 0)
continue;
puts(strerror(errors[i].error));
return 0;
hex->length -= n;
if (!(need -= n)) {
if (vflag == ALL || vflag == FIRST ||
- memcmp(curp, savp, hex->blocksize)) {
+ memcmp(curp, savp, hex->blocksize) != 0) {
if (vflag == DUP || vflag == FIRST)
vflag = WAIT;
return(curp);