LCOV - code coverage report
Current view: top level - shared - apparmor-util.c (source / functions) Hit Total Coverage
Test: main_coverage.info Lines: 6 7 85.7 %
Date: 2019-08-22 15:41:25 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /* SPDX-License-Identifier: LGPL-2.1+ */
       2             : 
       3             : #include <stddef.h>
       4             : 
       5             : #include "alloc-util.h"
       6             : #include "apparmor-util.h"
       7             : #include "fileio.h"
       8             : #include "parse-util.h"
       9             : 
      10           3 : bool mac_apparmor_use(void) {
      11             :         static int cached_use = -1;
      12             : 
      13           3 :         if (cached_use < 0) {
      14           2 :                 _cleanup_free_ char *p = NULL;
      15             : 
      16           1 :                 cached_use =
      17           1 :                         read_one_line_file("/sys/module/apparmor/parameters/enabled", &p) >= 0 &&
      18           0 :                         parse_boolean(p) > 0;
      19             :         }
      20             : 
      21           3 :         return cached_use;
      22             : }

Generated by: LCOV version 1.14