mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-09 23:19:26 +00:00
e4f2bcce24
When building with clang, multiple noreturn issues arise, for instance: selabel_partial_match.c:11:1: error: function 'usage' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn] Fix these. Signed-off-by: William Roberts <william.c.roberts@intel.com>
36 lines
664 B
C
36 lines
664 B
C
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <getopt.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/errno.h>
|
|
#include <selinux/selinux.h>
|
|
|
|
static __attribute__ ((__noreturn__)) void usage(const char *progname)
|
|
{
|
|
fprintf(stderr, "usage: %s tty_context...\n", progname);
|
|
exit(1);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int i;
|
|
if (argc < 2)
|
|
usage(argv[0]);
|
|
|
|
for (i = 1; i < argc; i++) {
|
|
switch (selinux_check_securetty_context(argv[i])) {
|
|
case 0:
|
|
printf("%s securetty.\n", argv[i]);
|
|
break;
|
|
default:
|
|
printf("%s not securetty.\n", argv[i]);
|
|
break;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|