diff options
author | Jim Meyering <meyering@redhat.com> | 2009-11-09 14:30:11 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-11-09 22:34:16 +0100 |
commit | 9a8889e4d0c532b9f77af3a9cc7aae06adebfb83 (patch) | |
tree | e2d7910ea5b028ed2628b8006f209eea843458e5 /fuse | |
parent | 3e70b34eed5a48640e20fbf6dcba774aaace1f3c (diff) | |
download | libguestfs-9a8889e4d0c532b9f77af3a9cc7aae06adebfb83.tar.gz libguestfs-9a8889e4d0c532b9f77af3a9cc7aae06adebfb83.tar.xz libguestfs-9a8889e4d0c532b9f77af3a9cc7aae06adebfb83.zip |
use STREQ, not strcmp: part 1
git grep -l 'strcmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
Diffstat (limited to 'fuse')
-rw-r--r-- | fuse/dircache.c | 8 | ||||
-rw-r--r-- | fuse/guestmount.c | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/fuse/dircache.c b/fuse/dircache.c index 545b9f38..10289260 100644 --- a/fuse/dircache.c +++ b/fuse/dircache.c @@ -100,7 +100,7 @@ gen_compare (void const *x, void const *y) { struct lsc_entry const *a = x; struct lsc_entry const *b = y; - return strcmp (a->pathname, b->pathname) == 0; + return STREQ (a->pathname, b->pathname); } static void @@ -250,7 +250,7 @@ lsc_insert (const char *path, const char *name, time_t now, free (entry); return -1; } - if (strcmp (path, "/") == 0) + if (STREQ (path, "/")) snprintf (entry->pathname, len, "/%s", name); else snprintf (entry->pathname, len, "%s/%s", path, name); @@ -285,7 +285,7 @@ xac_insert (const char *path, const char *name, time_t now, free (entry); return -1; } - if (strcmp (path, "/") == 0) + if (STREQ (path, "/")) snprintf (entry->pathname, len, "/%s", name); else snprintf (entry->pathname, len, "%s/%s", path, name); @@ -320,7 +320,7 @@ rlc_insert (const char *path, const char *name, time_t now, free (entry); return -1; } - if (strcmp (path, "/") == 0) + if (STREQ (path, "/")) snprintf (entry->pathname, len, "/%s", name); else snprintf (entry->pathname, len, "%s/%s", path, name); diff --git a/fuse/guestmount.c b/fuse/guestmount.c index 4547b3df..c7220c08 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -745,7 +745,7 @@ fg_getxattr (const char *path, const char *name, char *value, size_t i; int r = -ENOATTR; for (i = 0; i < xattrs->len; ++i) { - if (strcmp (xattrs->val[i].attrname, name) == 0) { + if (STREQ (xattrs->val[i].attrname, name)) { size_t sz = xattrs->val[i].attrval_len; if (sz > size) sz = size; @@ -993,13 +993,13 @@ main (int argc, char *argv[]) switch (c) { case 0: /* options which are long only */ - if (strcmp (long_options[option_index].name, "dir-cache-timeout") == 0) + if (STREQ (long_options[option_index].name, "dir-cache-timeout")) dir_cache_timeout = atoi (optarg); - else if (strcmp (long_options[option_index].name, "fuse-help") == 0) + else if (STREQ (long_options[option_index].name, "fuse-help")) fuse_help (); - else if (strcmp (long_options[option_index].name, "selinux") == 0) + else if (STREQ (long_options[option_index].name, "selinux")) guestfs_set_selinux (g, 1); - else if (strcmp (long_options[option_index].name, "trace") == 0) { + else if (STREQ (long_options[option_index].name, "trace")) { ADD_FUSE_ARG ("-f"); guestfs_set_trace (g, 1); guestfs_set_recovery_proc (g, 1); |