Skip to content

Instantly share code, notes, and snippets.

Created June 2, 2013 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5692818 to your computer and use it in GitHub Desktop.
Save anonymous/5692818 to your computer and use it in GitHub Desktop.
stdin
int check_is_linkfile(inode_t *i, struct iatt *s, dict_t *x)
{
mode_t m = st_mode_from_ia ((s)->ia_prot, (s)->ia_type) & ~S_IFMT;
char *buffer;
int foo = inode_path(i, NULL, &buffer);
fprintf(stderr, "looking up linked-ness for '%s'\n", buffer);
if (m != DHT_LINKFILE_MODE) {
fprintf(stderr, "mode doesn't match: %o\n", m);
return 0;
}
if (! dict_get (x, DHT_LINKFILE_KEY)) {
fprintf(stderr, "key says it isn't a linkfile\n");
return 0;
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment