diff options
author | Michael Schroeder <mls@suse.de> | 2012-10-29 15:55:57 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-10-29 15:55:57 +0100 |
commit | 50ada341c2ef6d348c59b4478fdfacf956369f69 (patch) | |
tree | e56701f31d9f964131a633a00b00b1e612d70f4d /bindings | |
parent | d16e24a7df388dc2e8c2d373446d93f09ef3d517 (diff) | |
download | libsolv-50ada341c2ef6d348c59b4478fdfacf956369f69.tar.gz libsolv-50ada341c2ef6d348c59b4478fdfacf956369f69.tar.bz2 libsolv-50ada341c2ef6d348c59b4478fdfacf956369f69.zip |
unify cookie generation for solv/pysolv/rbsolv/p5solv
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/solv.i | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bindings/solv.i b/bindings/solv.i index 4401752..d551957 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -840,6 +840,15 @@ typedef struct { solv_chksum_add($self, &stb.st_size, sizeof(stb.st_size)); solv_chksum_add($self, &stb.st_mtime, sizeof(stb.st_mtime)); } + void add_fstat(int fd) { + struct stat stb; + if (fstat(fd, &stb)) + memset(&stb, 0, sizeof(stb)); + solv_chksum_add($self, &stb.st_dev, sizeof(stb.st_dev)); + solv_chksum_add($self, &stb.st_ino, sizeof(stb.st_ino)); + solv_chksum_add($self, &stb.st_size, sizeof(stb.st_size)); + solv_chksum_add($self, &stb.st_mtime, sizeof(stb.st_mtime)); + } SWIGCDATA raw() { int l; const unsigned char *b; |