diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2025-10-18 19:07:35 +0200 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2025-10-18 19:07:35 +0200 |
| commit | fa23d938c040bc8af305a31fa874df55b2a02576 (patch) | |
| tree | 9704e2f7bd8962ea8911cd6f4e2d37227d7eff2e /tests/same-inode.h | |
| parent | df9dbf9b0915e432a4a2c4182f60af36374eaaab (diff) | |
| parent | 693ae7b71dfdd1a8146266b5794a71c0dbe5dff0 (diff) | |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tests/same-inode.h')
| -rw-r--r-- | tests/same-inode.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/same-inode.h b/tests/same-inode.h index 13ae24b7..70f17b03 100644 --- a/tests/same-inode.h +++ b/tests/same-inode.h @@ -1,6 +1,6 @@ /* Determine whether two stat buffers are known to refer to the same file. - Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -77,12 +77,17 @@ extern "C" { #define SAME_INODE(a, b) PSAME_INODE (&(a), &(b)) /* True if *A and *B represent the same file. Unlike PSAME_INODE, - args are evaluated once and must point to struct stat. */ + args are evaluated once and must point to struct stat, + and this function works even on POSIX platforms where fstat etc. do + not return useful st_dev and st_ino values for shared memory + objects and typed memory objects. */ SAME_INODE_INLINE bool psame_inode (struct stat const *a, struct stat const *b) { - return PSAME_INODE (a, b); + return (! (S_TYPEISSHM (a) | S_TYPEISTMO (a) + | S_TYPEISSHM (b) | S_TYPEISTMO (b)) + && PSAME_INODE (a, b)); } |
