Jason Hatton <jhatton@xxxxxxxxxxxxxxxxxxx> writes: > We could probably write the below to do the same thing. > > void fill_stat_data(struct stat_data *sd, struct stat *st) > { > sd->sd_ctime.sec = (unsigned int)st->st_ctime; > sd->sd_mtime.sec = (unsigned int)st->st_mtime; > sd->sd_ctime.nsec = ST_CTIME_NSEC(*st); > sd->sd_mtime.nsec = ST_MTIME_NSEC(*st); > sd->sd_dev = st->st_dev; > sd->sd_ino = st->st_ino; > sd->sd_uid = st->st_uid; > sd->sd_gid = st->st_gid; > sd->sd_size = st->st_size; > + if (sd->sd_size == 0 && st->st_size!= 0) { > + sd->sd_size = 1; > + } > } The above is a fairly straight-forward inlining (except that it does explicit comparisons with zero) of the helper function the version of patch under discussion added, and uses 1 instead of (1<<31) as an arbigrary nonzero number that can be used to work around the issue. So I agree with you that it would do the same thing. I am not surprised if it also gets scolded by Coverity the same way, though.