util_errors.h revision 1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4
8a5e793a0576250da80371e53aa3e7eba15cdb63Sumit Bose/*
ecd6aa105c55994db06993bab3c967247656bacbStephen Gallagher Copyright (C) 2012 Red Hat
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik This program is free software; you can redistribute it and/or modify
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik it under the terms of the GNU General Public License as published by
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik the Free Software Foundation; either version 3 of the License, or
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik (at your option) any later version.
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik
1f7573f8c74ff0f488a15969caed13034a95bd0fStephen Gallagher This program is distributed in the hope that it will be useful,
1f7573f8c74ff0f488a15969caed13034a95bd0fStephen Gallagher but WITHOUT ANY WARRANTY; without even the implied warranty of
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bfbf5cb0f00c60c0f000f56c282377b13b9a89abSumit Bose GNU General Public License for more details.
2344d7f71dd80618a41745b0818b46895fa61b2cLukas Slebodnik
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta You should have received a copy of the GNU General Public License
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta along with this program. If not, see <http://www.gnu.org/licenses/>.
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta Authors:
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta Simo Sorce <ssorce@redhat.com>
b96988a35bfb5f6faf2e364ae966166398afeca3Stephen Gallagher*/
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta#ifndef __SSSD_UTIL_ERRORS_H__
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta#define __SSSD_UTIL_ERRORS_H__
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta
a098b26a2a902cfb2968ca44604f61bf000d8413Stephen Gallagher#ifndef HAVE_ERRNO_T
a098b26a2a902cfb2968ca44604f61bf000d8413Stephen Gallagher#define HAVE_ERRNO_T
78e5b91e6b22efbcd0621144b104ac9dfd487e5bJakub Hrozektypedef int errno_t;
287e76479d68db4134274d4a4fca5fe0fbc9a605Jan Cholasta#endif
78e5b91e6b22efbcd0621144b104ac9dfd487e5bJakub Hrozek
78e5b91e6b22efbcd0621144b104ac9dfd487e5bJakub Hrozek/*
0b52717b76bf306afd30bbeb6d6c619365cfb548Stephen Gallagher * We define a specific number space so that we do not overlap with other
0b52717b76bf306afd30bbeb6d6c619365cfb548Stephen Gallagher * generic errors returned by various libraries. This will make it easy
0b52717b76bf306afd30bbeb6d6c619365cfb548Stephen Gallagher * to have functions that double check that what was returned was a SSSD
2344d7f71dd80618a41745b0818b46895fa61b2cLukas Slebodnik * specific error where it matters. For example we may want to ensure some
12a73062d84fec27536b09fd275ea248d14b93e5Jakub Hrozek * particularly sensitive paths only return SSSD sepcific errors as that
12a73062d84fec27536b09fd275ea248d14b93e5Jakub Hrozek * will insure all error conditions have been explicitly dealt with,
12a73062d84fec27536b09fd275ea248d14b93e5Jakub Hrozek * and are not the result of assigning the wrong return result.
2344d7f71dd80618a41745b0818b46895fa61b2cLukas Slebodnik *
c3b1e99007d5f0069fbbd32a3df799d71ea4882eSumit Bose * Basic system errno errors can still be used, but when an error condition
c3b1e99007d5f0069fbbd32a3df799d71ea4882eSumit Bose * does not properly map to a system error we should use a SSSD specific one
c3b1e99007d5f0069fbbd32a3df799d71ea4882eSumit Bose */
c3b1e99007d5f0069fbbd32a3df799d71ea4882eSumit Bose
c3b1e99007d5f0069fbbd32a3df799d71ea4882eSumit Bose#define ERR_BASE 0x555D0000
8a5e793a0576250da80371e53aa3e7eba15cdb63Sumit Bose#define ERR_MASK 0x0000FFFF
8a5e793a0576250da80371e53aa3e7eba15cdb63Sumit Bose
8a5e793a0576250da80371e53aa3e7eba15cdb63Sumit Bose/* never use ERR_INVALID, it is used for catching and returning
Error!

 

There was an error!

null

java.lang.NullPointerException