libc!setmode.c: Avoid #if inside macro call

#if inside macro call is undefined behaviour under the C standard
(3.8.3 paragraph 10 for C90, 6.8.10 paragraph 11 for C99).
The same effect can be achieved with a slightly more verbose construct,
putting the whole macro call inside the #ifdef/#else/#endif.
This commit is contained in:
Antoine Leca 2010-10-25 18:03:36 +01:00 committed by Ben Gras
parent 3b82f9106d
commit 6d8d7a88b2

View file

@ -236,11 +236,11 @@ setmode(p)
goto out;
}
perm = (mode_t)lval;
ADDCMD('=', (STANDARD_BITS
#ifdef S_ISTXT
|S_ISTXT
ADDCMD('=', (STANDARD_BITS|S_ISTXT), perm, mask);
#else
ADDCMD('=', (STANDARD_BITS), perm, mask);
#endif
), perm, mask);
set->cmd = 0;
return (saveset);
}