From: Michal J. <mi...@ha...> - 2004-07-05 20:15:45
|
On Thu, Jun 17, 2004 at 10:10:19AM -0600, Kevin Russell wrote: > > The following test would be better: > > r = getxattr(path, BPROC_STATE_XATTR, info->status, sizeof(info->status)); > if (r < 0 || r > sizeof(info->status)){ > errno = BE_INVALIDNODE; > return -1; > } > > r = getxattr(path, BPROC_ADDR_XATTR, info->status, sizeof(info->addr)); > if (r < 0 || r > sizeof(info->status)){ ^^^^ > errno = BE_INVALIDNODE; > return -1; > } Should that be in the second case 'sizeof(info->status)' or rather 'sizeof(info->addr)'? Even looking through kernel sources does not make that more clear to me. Also results of 'sizeof()' are unsigned and long so explicit casts on comparisons with ints would be likely good. Michal |