From ec6feaaed4f9fd8fe71e6de888cb1dd72b0872c8 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 17 Feb 2004 03:35:57 +0000 Subject: [PATCH] Under Win32, stat() returns an st_ino field, but it has no meaning (on Win2K, and possibly all Win32 variants, it is always 0). This causes a number of problems in the dfmgr.c logic, which basically all revolve around the fact that *any* two files will appear to have the same inode. Claudio Natoli --- src/backend/utils/fmgr/dfmgr.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index 3a66da5dc7..676eb96647 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.69 2004/01/19 02:06:41 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.70 2004/02/17 03:35:57 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -30,7 +30,9 @@ typedef struct df_files { struct df_files *next; /* List link */ dev_t device; /* Device file is on */ +#ifndef WIN32 /* ensures we never again depend on this under win32 */ ino_t inode; /* Inode number of file */ +#endif void *handle; /* a handle for pg_dl* functions */ char filename[1]; /* Full pathname of file */ @@ -43,7 +45,12 @@ typedef struct df_files static DynamicFileList *file_list = NULL; static DynamicFileList *file_tail = NULL; +/* stat() call under Win32 returns an st_ino field, but it has no meaning */ +#ifndef WIN32 #define SAME_INODE(A,B) ((A).st_ino == (B).inode && (A).st_dev == (B).device) +#else +#define SAME_INODE(A,B) false +#endif char *Dynamic_library_path; @@ -121,7 +128,9 @@ load_external_function(char *filename, char *funcname, MemSet((char *) file_scanner, 0, sizeof(DynamicFileList)); strcpy(file_scanner->filename, fullname); file_scanner->device = stat_buf.st_dev; +#ifndef WIN32 file_scanner->inode = stat_buf.st_ino; +#endif file_scanner->next = NULL; file_scanner->handle = pg_dlopen(fullname); -- 2.40.0