run_init: fix open_init_pty avaibility check

If /usr/sbin/open_init_pty is not found or is not executable,
access("/usr/sbin/open_init_pty", X_OK) returns -1, not zero.

Use "!= 0" like in other places in SELinux userland libraries and tools.
This commit is contained in:
Nicolas Iooss 2014-12-31 00:00:53 +01:00 committed by Stephen Smalley
parent 78a472da14
commit 4be2fd4576

View File

@ -406,7 +406,7 @@ int main(int argc, char *argv[])
new_context);
exit(-1);
}
if (! access("/usr/sbin/open_init_pty", X_OK)) {
if (access("/usr/sbin/open_init_pty", X_OK) != 0) {
if (execvp(argv[1], argv + 1)) {
perror("execvp");
exit(-1);