fnck.c (417B)
1 /* See LICENSE file for copyright and license details. */ 2 #include <sys/stat.h> 3 4 #include "../util.h" 5 6 void 7 fnck(const char *a, const char *b, int (*fn)(const char *, const char *)) 8 { 9 struct stat sta, stb; 10 11 if (!stat(a, &sta) 12 && !stat(b, &stb) 13 && sta.st_dev == stb.st_dev 14 && sta.st_ino == stb.st_ino) { 15 eprintf("%s -> %s: same file\n", a, b); 16 } 17 18 if (fn(a, b) < 0) 19 eprintf("%s -> %s:", a, b); 20 }