aboutsummaryrefslogtreecommitdiff
path: root/win32/mingw.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-01-04 12:29:19 +0000
committerRon Yorston <rmy@pobox.com>2019-01-04 15:06:26 +0000
commit0ffd8b3261e764179572d58179ae8e2c21635220 (patch)
tree29b297fe574d2d31564112a8c75becb3fb1d8464 /win32/mingw.c
parent6b6c55e16f121976334b857a646d82c2fec0a07b (diff)
downloadbusybox-w32-0ffd8b3261e764179572d58179ae8e2c21635220.tar.gz
busybox-w32-0ffd8b3261e764179572d58179ae8e2c21635220.tar.bz2
busybox-w32-0ffd8b3261e764179572d58179ae8e2c21635220.zip
win32: reduce static storage needed for lazy loading
Only the generic function pointer and initialisation flag need to be in static storage. The DLL and function names and the specialised function pointer can be local.
Diffstat (limited to 'win32/mingw.c')
-rw-r--r--win32/mingw.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 15f94d86c..c420992d5 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -881,13 +881,11 @@ int link(const char *oldpath, const char *newpath)
881static char *resolve_symlinks(char *path) 881static char *resolve_symlinks(char *path)
882{ 882{
883 HANDLE h = INVALID_HANDLE_VALUE; 883 HANDLE h = INVALID_HANDLE_VALUE;
884 DECLARE_PROC_ADDR(kernel32.dll, DWORD, GetFinalPathNameByHandleA, HANDLE, 884 DECLARE_PROC_ADDR(DWORD, GetFinalPathNameByHandleA, HANDLE,
885 LPSTR, DWORD, DWORD); 885 LPSTR, DWORD, DWORD);
886 886
887 if (!INIT_PROC_ADDR(GetFinalPathNameByHandleA)) { 887 if (!INIT_PROC_ADDR(kernel32.dll, GetFinalPathNameByHandleA))
888 errno = ENOSYS;
889 return NULL; 888 return NULL;
890 }
891 889
892 /* need a file handle to resolve symlinks */ 890 /* need a file handle to resolve symlinks */
893 h = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL, 891 h = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, NULL,
@@ -1282,9 +1280,9 @@ off_t mingw_lseek(int fd, off_t offset, int whence)
1282 1280
1283ULONGLONG CompatGetTickCount64(void) 1281ULONGLONG CompatGetTickCount64(void)
1284{ 1282{
1285 DECLARE_PROC_ADDR(kernel32.dll, ULONGLONG, GetTickCount64, void); 1283 DECLARE_PROC_ADDR(ULONGLONG, GetTickCount64, void);
1286 1284
1287 if (!INIT_PROC_ADDR(GetTickCount64)) { 1285 if (!INIT_PROC_ADDR(kernel32.dll, GetTickCount64)) {
1288 return (ULONGLONG)GetTickCount(); 1286 return (ULONGLONG)GetTickCount();
1289 } 1287 }
1290 1288