by inopinatus · 8y ago · 0 comments
if ((Lflag ? chown : lchown)(p->fts_accpath, -1, s->st_gid))
/* .. */
a line that turned out to be incredibly polarising amongst code reviewers.Explanation for those not well versed in C: the ternary in the left-hand parentheses is selecting which syscall wrapper function will be dereferenced and called with the arguments in the right-hand parentheses. It relies on the chown(2) and lchown(2) syscall wrappers having identical function signatures.