OpenCoverage

acl-errno-valid.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/acl-errno-valid.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/* Test whether ACLs are well supported on this system.-
2-
3 Copyright 2013-2018 Free Software Foundation, Inc.-
4-
5 This program is free software: you can redistribute it and/or modify-
6 it under the terms of the GNU General Public License as published by-
7 the Free Software Foundation; either version 3 of the License, or-
8 (at your option) any later version.-
9-
10 This program is distributed in the hope that it will be useful,-
11 but WITHOUT ANY WARRANTY; without even the implied warranty of-
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-
13 GNU General Public License for more details.-
14-
15 You should have received a copy of the GNU General Public License-
16 along with this program. If not, see <https://www.gnu.org/licenses/>.-
17-
18 Written by Paul Eggert. */-
19-
20#include <config.h>-
21-
22#include <acl.h>-
23-
24#include <errno.h>-
25-
26/* Return true if errno value ERRNUM indicates that ACLs are well-
27 supported on this system. ERRNUM should be an errno value obtained-
28 after an ACL-related system call fails. */-
29bool-
30acl_errno_valid (int errnum)-
31{-
32 /* Recognize some common errors such as from an NFS mount that does-
33 not support ACLs, even when local drives do. */-
34 switch (errnum)-
35 {-
36 case EBUSY: return false;
never executed: return 0 ;
never executed: case 16 :
0
37 case EINVAL: return false;
never executed: return 0 ;
never executed: case 22 :
0
38#if defined __APPLE__ && defined __MACH__-
39 case ENOENT: return false;-
40#endif-
41 case ENOSYS: return false;
never executed: return 0 ;
never executed: case 38 :
0
42-
43#if defined ENOTSUP && ENOTSUP != EOPNOTSUPP-
44# if ENOTSUP != ENOSYS /* Needed for the MS-Windows port of GNU Emacs. */-
45 case ENOTSUP: return false;-
46# endif-
47#endif-
48-
49 case EOPNOTSUPP: return false;
never executed: return 0 ;
never executed: case 95 :
0
50 default: return true;
never executed: return 1 ;
never executed: default:
0
51 }-
52}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.1.2