aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_wrappers.c
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2015-09-01 15:23:05 -0500
committerPeter Seebach <peter.seebach@windriver.com>2015-09-01 16:23:36 -0500
commit65c0b6ba05f8b86de18adc40530fd7ffae8c1643 (patch)
tree70d9236db5d0ab2a0cacc2dfbd30964c3e1f8d8c /pseudo_wrappers.c
parentcbcbe467c147f8c985bd38e34ab9adb72440f539 (diff)
downloadpseudo-65c0b6ba05f8b86de18adc40530fd7ffae8c1643.tar.gz
pseudo-65c0b6ba05f8b86de18adc40530fd7ffae8c1643.tar.bz2
pseudo-65c0b6ba05f8b86de18adc40530fd7ffae8c1643.zip
Don't use bare lstat.
lstat can fail on XFS if the inode number won't fit in a 32-bit value. Use base_lstat. Also, just in case, don't call it if it's not initialized yet (which should never happen). Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Diffstat (limited to 'pseudo_wrappers.c')
-rw-r--r--pseudo_wrappers.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c
index 7920f9e..34d7f23 100644
--- a/pseudo_wrappers.c
+++ b/pseudo_wrappers.c
@@ -92,8 +92,10 @@ extern ssize_t (*pseudo_real_fgetxattr)(int, const char *, void *, size_t);
extern int (*pseudo_real_lsetxattr)(const char *, const char *, const void *, size_t, int);
extern int (*pseudo_real_fsetxattr)(int, const char *, const void *, size_t, int);
#endif
-extern int (*pseudo_real_lstat)(const char *, struct stat *);
-extern int (*pseudo_real_fstat)(int, struct stat *);
+/* later, the init code can change these to refer to the real calls and
+ * skip the wrappers.
+ */
+extern int (*pseudo_real_lstat)(const char *path, PSEUDO_STATBUF *buf);
static void
_libpseudo_init(void) {
@@ -175,8 +177,7 @@ pseudo_init_wrappers(void) {
pseudo_real_lsetxattr = real_lsetxattr;
pseudo_real_fsetxattr = real_fsetxattr;
#endif
- pseudo_real_lstat = real_lstat;
- pseudo_real_fstat = real_fstat;
+ pseudo_real_lstat = base_lstat;
/* Once the wrappers are setup, we can now use open... so
* setup the logfile, if necessary...