Archived
1
0
Fork 0

Adding utils.c.

This commit is contained in:
Henrik Hautakoski 2013-02-08 21:54:54 +01:00
parent e78f8bea4d
commit c1b99a9e7e
2 changed files with 23 additions and 0 deletions

13
utils.c Normal file
View file

@ -0,0 +1,13 @@
#include <sys/stat.h>
#include "utils.h"
int file_cmp(const char *a, const char *b) {
struct stat sa, sb;
if (stat(a, &sa) < 0 || stat(b, &sb) < 0)
return 0;
return sa.st_dev == sb.st_dev &&
sa.st_ino == sb.st_ino;
}