Skip to content

Commit

Permalink
Do not hardcode error numbers
Browse files Browse the repository at this point in the history
The error numbers defined on Linux can not be reused on other systems
since this causes clashes.

On Linux ECHRNG is 44, but defining ECHRNG to be 44 on systems that do
not define ECHRNG is not appropriate. On e.g. kFreeBSD this will clash
with ESOCKTNOSUPPORT, which is defined as 44 on that system.
  • Loading branch information
ellert authored and gganis committed Nov 23, 2021
1 parent 1ceec9b commit b1a14a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/XrdPosix/XrdPosixMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#define ENOSR ENOSPC
#endif

#ifndef ECHRNG
#define ECHRNG EINVAL
#endif

/******************************************************************************/
/* S t a t i c M e m b e r s */
/******************************************************************************/
Expand Down Expand Up @@ -80,10 +84,6 @@ mode_t XrdPosixMap::Flags2Mode(dev_t *rdv, uint32_t flags)
/* Private: m a p C o d e */
/******************************************************************************/

#ifndef ECHRNG
#define ECHRNG 44
#endif

int XrdPosixMap::mapCode(int rc)
{
switch(rc)
Expand Down

0 comments on commit b1a14a6

Please sign in to comment.