]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
raw: fix raw query
authorKarel Zak <kzak@redhat.com>
Tue, 13 Jan 2015 08:53:46 +0000 (09:53 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 13 Jan 2015 08:53:46 +0000 (09:53 +0100)
Bug introduced by commit cd121363.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1181444
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/raw.c

index cc6690145e3fe7fd1f3d0226eb1182e6705c92d1..d29ff1ba3d4a127e81791c0ca73afd9bb69dc92f 100644 (file)
@@ -224,7 +224,7 @@ static int query(int minor_raw, const char *raw_name, int quiet)
        if (raw_name) {
                struct stat statbuf;
 
-               if (!stat(raw_name, &statbuf))
+               if (stat(raw_name, &statbuf) != 0)
                        err(EXIT_RAW_ACCESS,
                            _("Cannot locate raw device '%s'"), raw_name);
                if (!S_ISCHR(statbuf.st_mode))