if((lsb.st_dev != fsb.st_dev) || (lsb.st_ino != fsb.st_ino) || (lsb.st_mode != fsb.st_mode) || (lsb.st_nlink != fsb.st_nlink) || (lsb.st_uid != fsb.st_uid) || (lsb.st_gid != fsb.st_gid) || (lsb.st_rdev != fsb.st_rdev) || (lsb.st_size != fsb.st_size)) {  return -1; }
dotlock_prepare(char *bn, size_t l, const char *f){  struct stat fsb, lsb;  char realpath[_POSIX_PATH_MAX];  char *basename, *dirname;  char *p;  int fd;  int r;    if(dotlock_deference_symlink(realpath, sizeof(realpath), f) == -1)    return -1;    if((p = strrchr(realpath, '/')))  {    *p = '\0';    basename = p + 1;    dirname = realpath;  }  else  {    basename = realpath;    dirname = ".";  }  if(strlen(basename) + 1 > l)    return -1;    strfcpy(bn, basename, l);    if(chdir(dirname) == -1)    return -1;    if((fd = open(basename, O_RDONLY)) == -1)    return -1;    r = fstat(fd, &fsb);  close(fd);    if(r == -1)    return -1;    if(lstat(basename, &lsb) == -1)    return -1;    if(S_ISLNK(lsb.st_mode))    return -1;    if((lsb.st_dev != fsb.st_dev) ||     (lsb.st_ino != fsb.st_ino) ||     (lsb.st_mode != fsb.st_mode) ||     (lsb.st_nlink != fsb.st_nlink) ||     (lsb.st_uid != fsb.st_uid) ||     (lsb.st_gid != fsb.st_gid) ||     (lsb.st_rdev != fsb.st_rdev) ||     (lsb.st_size != fsb.st_size))  {    /* something's fishy */    return -1;  }    return 0;}