diff options
Diffstat (limited to 'libltdl/ltdl.c')
-rw-r--r-- | libltdl/ltdl.c | 226 |
1 files changed, 113 insertions, 113 deletions
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 8ad947dc..b72cf723 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c | |||
@@ -42,7 +42,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |||
42 | #if HAVE_STDLIB_H | 42 | #if HAVE_STDLIB_H |
43 | # include <stdlib.h> | 43 | # include <stdlib.h> |
44 | #else | 44 | #else |
45 | # if HAVE_MALLOC_H | 45 | # if HAVE_GNUNET_malloc_H |
46 | # include <malloc.h> | 46 | # include <malloc.h> |
47 | # endif | 47 | # endif |
48 | #endif | 48 | #endif |
@@ -128,7 +128,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |||
128 | 128 | ||
129 | #include "ltdl.h" | 129 | #include "ltdl.h" |
130 | 130 | ||
131 | #if WITH_DMALLOC | 131 | #if WITH_DGNUNET_malloc |
132 | # include <dmalloc.h> | 132 | # include <dmalloc.h> |
133 | #endif | 133 | #endif |
134 | 134 | ||
@@ -228,24 +228,24 @@ LT_PARAMS ((size_t size)) = (lt_ptr (*)LT_PARAMS ((size_t))) malloc; | |||
228 | 228 | ||
229 | /* The following macros reduce the amount of typing needed to cast | 229 | /* The following macros reduce the amount of typing needed to cast |
230 | assigned memory. */ | 230 | assigned memory. */ |
231 | #if WITH_DMALLOC | 231 | #if WITH_DGNUNET_malloc |
232 | 232 | ||
233 | #define LT_DLMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) | 233 | #define LT_DLGNUNET_malloc(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) |
234 | #define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) | 234 | #define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) |
235 | #define LT_DLFREE(p) \ | 235 | #define LT_DLGNUNET_free(p) \ |
236 | LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END | 236 | LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END |
237 | 237 | ||
238 | #define LT_EMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) | 238 | #define LT_EGNUNET_malloc(tp, n) ((tp *) xmalloc ((n) * sizeof(tp))) |
239 | #define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) | 239 | #define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp))) |
240 | 240 | ||
241 | #else | 241 | #else |
242 | 242 | ||
243 | #define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp))) | 243 | #define LT_DLGNUNET_malloc(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp))) |
244 | #define LT_DLREALLOC(tp, p, n) ((tp *) lt_dlrealloc ((p), (n) * sizeof(tp))) | 244 | #define LT_DLREALLOC(tp, p, n) ((tp *) lt_dlrealloc ((p), (n) * sizeof(tp))) |
245 | #define LT_DLFREE(p) \ | 245 | #define LT_DLGNUNET_free(p) \ |
246 | LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END | 246 | LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END |
247 | 247 | ||
248 | #define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp))) | 248 | #define LT_EGNUNET_malloc(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp))) |
249 | #define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) | 249 | #define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp))) |
250 | 250 | ||
251 | #endif | 251 | #endif |
@@ -270,7 +270,7 @@ LT_PARAMS ((size_t size)) = (lt_ptr (*)LT_PARAMS ((size_t))) malloc; | |||
270 | 270 | ||
271 | if (str) | 271 | if (str) |
272 | { | 272 | { |
273 | tmp = LT_DLMALLOC (char, 1 + strlen (str)); | 273 | tmp = LT_DLGNUNET_malloc (char, 1 + strlen (str)); |
274 | if (tmp) | 274 | if (tmp) |
275 | { | 275 | { |
276 | strcpy (tmp, str); | 276 | strcpy (tmp, str); |
@@ -455,7 +455,7 @@ opendir (path) | |||
455 | assert (path != (char *) NULL); | 455 | assert (path != (char *) NULL); |
456 | (void) strncpy (file_specification, path, LT_FILENAME_MAX - 1); | 456 | (void) strncpy (file_specification, path, LT_FILENAME_MAX - 1); |
457 | (void) strcat (file_specification, "\\"); | 457 | (void) strcat (file_specification, "\\"); |
458 | entry = LT_DLMALLOC (DIR, sizeof (DIR)); | 458 | entry = LT_DLGNUNET_malloc (DIR, sizeof (DIR)); |
459 | if (entry != (DIR *) 0) | 459 | if (entry != (DIR *) 0) |
460 | { | 460 | { |
461 | entry->firsttime = TRUE; | 461 | entry->firsttime = TRUE; |
@@ -469,7 +469,7 @@ opendir (path) | |||
469 | FindFirstFile (file_specification, &entry->Win32FindData); | 469 | FindFirstFile (file_specification, &entry->Win32FindData); |
470 | if (entry->hSearch == INVALID_HANDLE_VALUE) | 470 | if (entry->hSearch == INVALID_HANDLE_VALUE) |
471 | { | 471 | { |
472 | LT_DLFREE (entry); | 472 | LT_DLGNUNET_free (entry); |
473 | return (DIR *) 0; | 473 | return (DIR *) 0; |
474 | } | 474 | } |
475 | } | 475 | } |
@@ -628,7 +628,7 @@ argz_create_sep (str, delim, pargz, pargz_len) | |||
628 | const char *p; | 628 | const char *p; |
629 | char *q; | 629 | char *q; |
630 | 630 | ||
631 | argz = LT_DLMALLOC (char, argz_len); | 631 | argz = LT_DLGNUNET_malloc (char, argz_len); |
632 | if (!argz) | 632 | if (!argz) |
633 | return ENOMEM; | 633 | return ENOMEM; |
634 | 634 | ||
@@ -652,7 +652,7 @@ argz_create_sep (str, delim, pargz, pargz_len) | |||
652 | 652 | ||
653 | /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ | 653 | /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ |
654 | if (!argz_len) | 654 | if (!argz_len) |
655 | LT_DLFREE (argz); | 655 | LT_DLGNUNET_free (argz); |
656 | 656 | ||
657 | /* Assign new values. */ | 657 | /* Assign new values. */ |
658 | *pargz = argz; | 658 | *pargz = argz; |
@@ -870,7 +870,7 @@ static const char sys_search_path[] = LTDL_SYSSEARCHPATH; | |||
870 | 870 | ||
871 | 871 | ||
872 | 872 | ||
873 | /* --- MUTEX LOCKING --- */ | 873 | /* --- GNUNET_Mutex LOCKING --- */ |
874 | 874 | ||
875 | 875 | ||
876 | /* Macros to make it easier to run the lock functions only if they have | 876 | /* Macros to make it easier to run the lock functions only if they have |
@@ -878,7 +878,7 @@ static const char sys_search_path[] = LTDL_SYSSEARCHPATH; | |||
878 | ensure that the stored error message from the last error is not | 878 | ensure that the stored error message from the last error is not |
879 | accidentally erased if the current function doesn't generate an | 879 | accidentally erased if the current function doesn't generate an |
880 | error of its own. */ | 880 | error of its own. */ |
881 | #define LT_DLMUTEX_LOCK() LT_STMT_START { \ | 881 | #define LT_DLGNUNET_mutex_lock() LT_STMT_START { \ |
882 | if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \ | 882 | if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \ |
883 | } LT_STMT_END | 883 | } LT_STMT_END |
884 | #define LT_DLMUTEX_UNLOCK() LT_STMT_START { \ | 884 | #define LT_DLMUTEX_UNLOCK() LT_STMT_START { \ |
@@ -917,7 +917,7 @@ lt_dlmutex_register (lock, unlock, seterror, geterror) | |||
917 | int errors = 0; | 917 | int errors = 0; |
918 | 918 | ||
919 | /* Lock using the old lock() callback, if any. */ | 919 | /* Lock using the old lock() callback, if any. */ |
920 | LT_DLMUTEX_LOCK (); | 920 | LT_DLGNUNET_mutex_lock (); |
921 | 921 | ||
922 | if ((lock && unlock && seterror && geterror) | 922 | if ((lock && unlock && seterror && geterror) |
923 | || !(lock || unlock || seterror || geterror)) | 923 | || !(lock || unlock || seterror || geterror)) |
@@ -961,7 +961,7 @@ lt_dladderror (diagnostic) | |||
961 | 961 | ||
962 | assert (diagnostic); | 962 | assert (diagnostic); |
963 | 963 | ||
964 | LT_DLMUTEX_LOCK (); | 964 | LT_DLGNUNET_mutex_lock (); |
965 | 965 | ||
966 | errindex = errorcount - LT_ERROR_MAX; | 966 | errindex = errorcount - LT_ERROR_MAX; |
967 | temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex); | 967 | temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex); |
@@ -983,7 +983,7 @@ lt_dlseterror (errindex) | |||
983 | { | 983 | { |
984 | int errors = 0; | 984 | int errors = 0; |
985 | 985 | ||
986 | LT_DLMUTEX_LOCK (); | 986 | LT_DLGNUNET_mutex_lock (); |
987 | 987 | ||
988 | if (errindex >= errorcount || errindex < 0) | 988 | if (errindex >= errorcount || errindex < 0) |
989 | { | 989 | { |
@@ -1326,7 +1326,7 @@ sys_wll_open (loader_data, filename) | |||
1326 | { | 1326 | { |
1327 | /* Append a `.' to stop Windows from adding an | 1327 | /* Append a `.' to stop Windows from adding an |
1328 | implicit `.dll' extension. */ | 1328 | implicit `.dll' extension. */ |
1329 | searchname = LT_EMALLOC (char, 2 + LT_STRLEN (filename)); | 1329 | searchname = LT_EGNUNET_malloc (char, 2 + LT_STRLEN (filename)); |
1330 | if (searchname) | 1330 | if (searchname) |
1331 | sprintf (searchname, "%s.", filename); | 1331 | sprintf (searchname, "%s.", filename); |
1332 | } | 1332 | } |
@@ -1342,7 +1342,7 @@ sys_wll_open (loader_data, filename) | |||
1342 | #else | 1342 | #else |
1343 | module = LoadLibrary (searchname); | 1343 | module = LoadLibrary (searchname); |
1344 | #endif | 1344 | #endif |
1345 | LT_DLFREE (searchname); | 1345 | LT_DLGNUNET_free (searchname); |
1346 | 1346 | ||
1347 | /* libltdl expects this function to fail if it is unable | 1347 | /* libltdl expects this function to fail if it is unable |
1348 | to physically load the library. Sadly, LoadLibrary | 1348 | to physically load the library. Sadly, LoadLibrary |
@@ -1352,7 +1352,7 @@ sys_wll_open (loader_data, filename) | |||
1352 | We check whether LoadLibrary is returning a handle to | 1352 | We check whether LoadLibrary is returning a handle to |
1353 | an already loaded module, and simulate failure if we | 1353 | an already loaded module, and simulate failure if we |
1354 | find one. */ | 1354 | find one. */ |
1355 | LT_DLMUTEX_LOCK (); | 1355 | LT_DLGNUNET_mutex_lock (); |
1356 | cur = handles; | 1356 | cur = handles; |
1357 | while (cur) | 1357 | while (cur) |
1358 | { | 1358 | { |
@@ -1522,7 +1522,7 @@ sys_dld_open (loader_data, filename) | |||
1522 | if (dld_link (filename) != 0) | 1522 | if (dld_link (filename) != 0) |
1523 | { | 1523 | { |
1524 | LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); | 1524 | LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN)); |
1525 | LT_DLFREE (module); | 1525 | LT_DLGNUNET_free (module); |
1526 | module = 0; | 1526 | module = 0; |
1527 | } | 1527 | } |
1528 | 1528 | ||
@@ -1543,7 +1543,7 @@ sys_dld_close (loader_data, module) | |||
1543 | } | 1543 | } |
1544 | else | 1544 | else |
1545 | { | 1545 | { |
1546 | LT_DLFREE (module); | 1546 | LT_DLGNUNET_free (module); |
1547 | } | 1547 | } |
1548 | 1548 | ||
1549 | return errors; | 1549 | return errors; |
@@ -1982,7 +1982,7 @@ presym_init (loader_data) | |||
1982 | { | 1982 | { |
1983 | int errors = 0; | 1983 | int errors = 0; |
1984 | 1984 | ||
1985 | LT_DLMUTEX_LOCK (); | 1985 | LT_DLGNUNET_mutex_lock (); |
1986 | 1986 | ||
1987 | preloaded_symbols = 0; | 1987 | preloaded_symbols = 0; |
1988 | if (default_preloaded_symbols) | 1988 | if (default_preloaded_symbols) |
@@ -2000,7 +2000,7 @@ presym_free_symlists () | |||
2000 | { | 2000 | { |
2001 | lt_dlsymlists_t *lists; | 2001 | lt_dlsymlists_t *lists; |
2002 | 2002 | ||
2003 | LT_DLMUTEX_LOCK (); | 2003 | LT_DLGNUNET_mutex_lock (); |
2004 | 2004 | ||
2005 | lists = preloaded_symbols; | 2005 | lists = preloaded_symbols; |
2006 | while (lists) | 2006 | while (lists) |
@@ -2008,7 +2008,7 @@ presym_free_symlists () | |||
2008 | lt_dlsymlists_t *tmp = lists; | 2008 | lt_dlsymlists_t *tmp = lists; |
2009 | 2009 | ||
2010 | lists = lists->next; | 2010 | lists = lists->next; |
2011 | LT_DLFREE (tmp); | 2011 | LT_DLGNUNET_free (tmp); |
2012 | } | 2012 | } |
2013 | preloaded_symbols = 0; | 2013 | preloaded_symbols = 0; |
2014 | 2014 | ||
@@ -2033,7 +2033,7 @@ presym_add_symlist (preloaded) | |||
2033 | lt_dlsymlists_t *lists; | 2033 | lt_dlsymlists_t *lists; |
2034 | int errors = 0; | 2034 | int errors = 0; |
2035 | 2035 | ||
2036 | LT_DLMUTEX_LOCK (); | 2036 | LT_DLGNUNET_mutex_lock (); |
2037 | 2037 | ||
2038 | lists = preloaded_symbols; | 2038 | lists = preloaded_symbols; |
2039 | while (lists) | 2039 | while (lists) |
@@ -2045,7 +2045,7 @@ presym_add_symlist (preloaded) | |||
2045 | lists = lists->next; | 2045 | lists = lists->next; |
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | tmp = LT_EMALLOC (lt_dlsymlists_t, 1); | 2048 | tmp = LT_EGNUNET_malloc (lt_dlsymlists_t, 1); |
2049 | if (tmp) | 2049 | if (tmp) |
2050 | { | 2050 | { |
2051 | memset (tmp, 0, sizeof (lt_dlsymlists_t)); | 2051 | memset (tmp, 0, sizeof (lt_dlsymlists_t)); |
@@ -2071,7 +2071,7 @@ presym_open (loader_data, filename) | |||
2071 | lt_dlsymlists_t *lists; | 2071 | lt_dlsymlists_t *lists; |
2072 | lt_module module = (lt_module) 0; | 2072 | lt_module module = (lt_module) 0; |
2073 | 2073 | ||
2074 | LT_DLMUTEX_LOCK (); | 2074 | LT_DLGNUNET_mutex_lock (); |
2075 | lists = preloaded_symbols; | 2075 | lists = preloaded_symbols; |
2076 | 2076 | ||
2077 | if (!lists) | 2077 | if (!lists) |
@@ -2225,7 +2225,7 @@ lt_dlinit () | |||
2225 | { | 2225 | { |
2226 | int errors = 0; | 2226 | int errors = 0; |
2227 | 2227 | ||
2228 | LT_DLMUTEX_LOCK (); | 2228 | LT_DLGNUNET_mutex_lock (); |
2229 | 2229 | ||
2230 | /* Initialize only at first call. */ | 2230 | /* Initialize only at first call. */ |
2231 | if (++initialized == 1) | 2231 | if (++initialized == 1) |
@@ -2285,7 +2285,7 @@ lt_dlpreload (preloaded) | |||
2285 | { | 2285 | { |
2286 | presym_free_symlists (); | 2286 | presym_free_symlists (); |
2287 | 2287 | ||
2288 | LT_DLMUTEX_LOCK (); | 2288 | LT_DLGNUNET_mutex_lock (); |
2289 | if (default_preloaded_symbols) | 2289 | if (default_preloaded_symbols) |
2290 | { | 2290 | { |
2291 | errors = lt_dlpreload (default_preloaded_symbols); | 2291 | errors = lt_dlpreload (default_preloaded_symbols); |
@@ -2300,7 +2300,7 @@ int | |||
2300 | lt_dlpreload_default (preloaded) | 2300 | lt_dlpreload_default (preloaded) |
2301 | const lt_dlsymlist *preloaded; | 2301 | const lt_dlsymlist *preloaded; |
2302 | { | 2302 | { |
2303 | LT_DLMUTEX_LOCK (); | 2303 | LT_DLGNUNET_mutex_lock (); |
2304 | default_preloaded_symbols = preloaded; | 2304 | default_preloaded_symbols = preloaded; |
2305 | LT_DLMUTEX_UNLOCK (); | 2305 | LT_DLMUTEX_UNLOCK (); |
2306 | return 0; | 2306 | return 0; |
@@ -2313,7 +2313,7 @@ lt_dlexit () | |||
2313 | lt_dlloader *loader; | 2313 | lt_dlloader *loader; |
2314 | int errors = 0; | 2314 | int errors = 0; |
2315 | 2315 | ||
2316 | LT_DLMUTEX_LOCK (); | 2316 | LT_DLGNUNET_mutex_lock (); |
2317 | loader = loaders; | 2317 | loader = loaders; |
2318 | 2318 | ||
2319 | if (!initialized) | 2319 | if (!initialized) |
@@ -2389,7 +2389,7 @@ tryall_dlopen (handle, filename) | |||
2389 | int errors = 0; | 2389 | int errors = 0; |
2390 | 2390 | ||
2391 | LT_DLMUTEX_GETERROR (saved_error); | 2391 | LT_DLMUTEX_GETERROR (saved_error); |
2392 | LT_DLMUTEX_LOCK (); | 2392 | LT_DLGNUNET_mutex_lock (); |
2393 | 2393 | ||
2394 | cur = handles; | 2394 | cur = handles; |
2395 | loader = loaders; | 2395 | loader = loaders; |
@@ -2461,7 +2461,7 @@ tryall_dlopen (handle, filename) | |||
2461 | 2461 | ||
2462 | if (!loader) | 2462 | if (!loader) |
2463 | { | 2463 | { |
2464 | LT_DLFREE (cur->info.filename); | 2464 | LT_DLGNUNET_free (cur->info.filename); |
2465 | ++errors; | 2465 | ++errors; |
2466 | goto done; | 2466 | goto done; |
2467 | } | 2467 | } |
@@ -2503,7 +2503,7 @@ tryall_dlopen_module (handle, prefix, dirname, dlname) | |||
2503 | 2503 | ||
2504 | /* Allocate memory, and combine DIRNAME and MODULENAME into it. | 2504 | /* Allocate memory, and combine DIRNAME and MODULENAME into it. |
2505 | The PREFIX (if any) is handled below. */ | 2505 | The PREFIX (if any) is handled below. */ |
2506 | filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1); | 2506 | filename = LT_EGNUNET_malloc (char, dirname_len + 1 + filename_len + 1); |
2507 | if (!filename) | 2507 | if (!filename) |
2508 | return 1; | 2508 | return 1; |
2509 | 2509 | ||
@@ -2522,7 +2522,7 @@ tryall_dlopen_module (handle, prefix, dirname, dlname) | |||
2522 | ++error; | 2522 | ++error; |
2523 | } | 2523 | } |
2524 | 2524 | ||
2525 | LT_DLFREE (filename); | 2525 | LT_DLGNUNET_free (filename); |
2526 | return error; | 2526 | return error; |
2527 | } | 2527 | } |
2528 | 2528 | ||
@@ -2582,7 +2582,7 @@ canonicalize_path (path, pcanonical) | |||
2582 | assert (path && *path); | 2582 | assert (path && *path); |
2583 | assert (pcanonical); | 2583 | assert (pcanonical); |
2584 | 2584 | ||
2585 | canonical = LT_EMALLOC (char, 1 + LT_STRLEN (path)); | 2585 | canonical = LT_EGNUNET_malloc (char, 1 + LT_STRLEN (path)); |
2586 | if (!canonical) | 2586 | if (!canonical) |
2587 | return 1; | 2587 | return 1; |
2588 | 2588 | ||
@@ -2685,7 +2685,7 @@ foreach_dirinpath (search_path, base_name, func, data1, data2) | |||
2685 | char *filename = 0; | 2685 | char *filename = 0; |
2686 | char *canonical = 0; | 2686 | char *canonical = 0; |
2687 | 2687 | ||
2688 | LT_DLMUTEX_LOCK (); | 2688 | LT_DLGNUNET_mutex_lock (); |
2689 | 2689 | ||
2690 | if (!search_path || !*search_path) | 2690 | if (!search_path || !*search_path) |
2691 | { | 2691 | { |
@@ -2707,9 +2707,9 @@ foreach_dirinpath (search_path, base_name, func, data1, data2) | |||
2707 | 2707 | ||
2708 | if (lendir + 1 + lenbase >= filenamesize) | 2708 | if (lendir + 1 + lenbase >= filenamesize) |
2709 | { | 2709 | { |
2710 | LT_DLFREE (filename); | 2710 | LT_DLGNUNET_free (filename); |
2711 | filenamesize = lendir + 1 + lenbase + 1; /* "/d" + '/' + "f" + '\0' */ | 2711 | filenamesize = lendir + 1 + lenbase + 1; /* "/d" + '/' + "f" + '\0' */ |
2712 | filename = LT_EMALLOC (char, filenamesize); | 2712 | filename = LT_EGNUNET_malloc (char, filenamesize); |
2713 | if (!filename) | 2713 | if (!filename) |
2714 | goto cleanup; | 2714 | goto cleanup; |
2715 | } | 2715 | } |
@@ -2732,9 +2732,9 @@ foreach_dirinpath (search_path, base_name, func, data1, data2) | |||
2732 | } | 2732 | } |
2733 | 2733 | ||
2734 | cleanup: | 2734 | cleanup: |
2735 | LT_DLFREE (argz); | 2735 | LT_DLGNUNET_free (argz); |
2736 | LT_DLFREE (canonical); | 2736 | LT_DLGNUNET_free (canonical); |
2737 | LT_DLFREE (filename); | 2737 | LT_DLGNUNET_free (filename); |
2738 | 2738 | ||
2739 | LT_DLMUTEX_UNLOCK (); | 2739 | LT_DLMUTEX_UNLOCK (); |
2740 | 2740 | ||
@@ -2765,7 +2765,7 @@ find_file_callback (filename, data1, data2) | |||
2765 | if (dirend > filename) | 2765 | if (dirend > filename) |
2766 | *dirend = LT_EOS_CHAR; | 2766 | *dirend = LT_EOS_CHAR; |
2767 | 2767 | ||
2768 | LT_DLFREE (*pdir); | 2768 | LT_DLGNUNET_free (*pdir); |
2769 | *pdir = lt_estrdup (filename); | 2769 | *pdir = lt_estrdup (filename); |
2770 | is_done = (*pdir == 0) ? -1 : 1; | 2770 | is_done = (*pdir == 0) ? -1 : 1; |
2771 | } | 2771 | } |
@@ -2847,7 +2847,7 @@ load_deplibs (handle, deplibs) | |||
2847 | } | 2847 | } |
2848 | ++errors; | 2848 | ++errors; |
2849 | 2849 | ||
2850 | LT_DLMUTEX_LOCK (); | 2850 | LT_DLGNUNET_mutex_lock (); |
2851 | if (user_search_path) | 2851 | if (user_search_path) |
2852 | { | 2852 | { |
2853 | save_search_path = lt_estrdup (user_search_path); | 2853 | save_search_path = lt_estrdup (user_search_path); |
@@ -2891,7 +2891,7 @@ load_deplibs (handle, deplibs) | |||
2891 | } | 2891 | } |
2892 | 2892 | ||
2893 | /* restore the old search path */ | 2893 | /* restore the old search path */ |
2894 | LT_DLFREE (user_search_path); | 2894 | LT_DLGNUNET_free (user_search_path); |
2895 | user_search_path = save_search_path; | 2895 | user_search_path = save_search_path; |
2896 | 2896 | ||
2897 | LT_DLMUTEX_UNLOCK (); | 2897 | LT_DLMUTEX_UNLOCK (); |
@@ -2902,7 +2902,7 @@ load_deplibs (handle, deplibs) | |||
2902 | goto cleanup; | 2902 | goto cleanup; |
2903 | } | 2903 | } |
2904 | 2904 | ||
2905 | names = LT_EMALLOC (char *, depcount * sizeof (char *)); | 2905 | names = LT_EGNUNET_malloc (char *, depcount * sizeof (char *)); |
2906 | if (!names) | 2906 | if (!names) |
2907 | goto cleanup; | 2907 | goto cleanup; |
2908 | 2908 | ||
@@ -2931,7 +2931,7 @@ load_deplibs (handle, deplibs) | |||
2931 | if (strncmp (p, "-l", 2) == 0) | 2931 | if (strncmp (p, "-l", 2) == 0) |
2932 | { | 2932 | { |
2933 | size_t name_len = 3 + /* "lib" */ LT_STRLEN (p + 2); | 2933 | size_t name_len = 3 + /* "lib" */ LT_STRLEN (p + 2); |
2934 | name = LT_EMALLOC (char, 1 + name_len); | 2934 | name = LT_EGNUNET_malloc (char, 1 + name_len); |
2935 | if (name) | 2935 | if (name) |
2936 | sprintf (name, "lib%s", p + 2); | 2936 | sprintf (name, "lib%s", p + 2); |
2937 | } | 2937 | } |
@@ -2957,7 +2957,7 @@ load_deplibs (handle, deplibs) | |||
2957 | { | 2957 | { |
2958 | int j = 0; | 2958 | int j = 0; |
2959 | 2959 | ||
2960 | handle->deplibs = (lt_dlhandle *) LT_EMALLOC (lt_dlhandle *, depcount); | 2960 | handle->deplibs = (lt_dlhandle *) LT_EGNUNET_malloc (lt_dlhandle *, depcount); |
2961 | if (!handle->deplibs) | 2961 | if (!handle->deplibs) |
2962 | goto cleanup; | 2962 | goto cleanup; |
2963 | 2963 | ||
@@ -2977,11 +2977,11 @@ load_deplibs (handle, deplibs) | |||
2977 | cleanup_names: | 2977 | cleanup_names: |
2978 | for (i = 0; i < depcount; ++i) | 2978 | for (i = 0; i < depcount; ++i) |
2979 | { | 2979 | { |
2980 | LT_DLFREE (names[i]); | 2980 | LT_DLGNUNET_free (names[i]); |
2981 | } | 2981 | } |
2982 | 2982 | ||
2983 | cleanup: | 2983 | cleanup: |
2984 | LT_DLFREE (names); | 2984 | LT_DLGNUNET_free (names); |
2985 | #endif | 2985 | #endif |
2986 | 2986 | ||
2987 | return errors; | 2987 | return errors; |
@@ -3019,11 +3019,11 @@ trim (dest, str) | |||
3019 | size_t len = LT_STRLEN (str); | 3019 | size_t len = LT_STRLEN (str); |
3020 | char *tmp; | 3020 | char *tmp; |
3021 | 3021 | ||
3022 | LT_DLFREE (*dest); | 3022 | LT_DLGNUNET_free (*dest); |
3023 | 3023 | ||
3024 | if (len > 3 && str[0] == '\'') | 3024 | if (len > 3 && str[0] == '\'') |
3025 | { | 3025 | { |
3026 | tmp = LT_EMALLOC (char, end - str); | 3026 | tmp = LT_EGNUNET_malloc (char, end - str); |
3027 | if (!tmp) | 3027 | if (!tmp) |
3028 | return 1; | 3028 | return 1; |
3029 | 3029 | ||
@@ -3046,10 +3046,10 @@ free_vars (dlname, oldname, libdir, deplibs) | |||
3046 | char *libdir; | 3046 | char *libdir; |
3047 | char *deplibs; | 3047 | char *deplibs; |
3048 | { | 3048 | { |
3049 | LT_DLFREE (dlname); | 3049 | LT_DLGNUNET_free (dlname); |
3050 | LT_DLFREE (oldname); | 3050 | LT_DLGNUNET_free (oldname); |
3051 | LT_DLFREE (libdir); | 3051 | LT_DLGNUNET_free (libdir); |
3052 | LT_DLFREE (deplibs); | 3052 | LT_DLGNUNET_free (deplibs); |
3053 | 3053 | ||
3054 | return 0; | 3054 | return 0; |
3055 | } | 3055 | } |
@@ -3076,7 +3076,7 @@ try_dlopen (phandle, filename) | |||
3076 | /* dlopen self? */ | 3076 | /* dlopen self? */ |
3077 | if (!filename) | 3077 | if (!filename) |
3078 | { | 3078 | { |
3079 | *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); | 3079 | *phandle = (lt_dlhandle) LT_EGNUNET_malloc (struct lt_dlhandle_struct, 1); |
3080 | if (*phandle == 0) | 3080 | if (*phandle == 0) |
3081 | return 1; | 3081 | return 1; |
3082 | 3082 | ||
@@ -3088,7 +3088,7 @@ try_dlopen (phandle, filename) | |||
3088 | 3088 | ||
3089 | if (tryall_dlopen (&newhandle, 0) != 0) | 3089 | if (tryall_dlopen (&newhandle, 0) != 0) |
3090 | { | 3090 | { |
3091 | LT_DLFREE (*phandle); | 3091 | LT_DLGNUNET_free (*phandle); |
3092 | return 1; | 3092 | return 1; |
3093 | } | 3093 | } |
3094 | 3094 | ||
@@ -3112,7 +3112,7 @@ try_dlopen (phandle, filename) | |||
3112 | { | 3112 | { |
3113 | size_t dirlen = (1 + base_name) - canonical; | 3113 | size_t dirlen = (1 + base_name) - canonical; |
3114 | 3114 | ||
3115 | dir = LT_EMALLOC (char, 1 + dirlen); | 3115 | dir = LT_EGNUNET_malloc (char, 1 + dirlen); |
3116 | if (!dir) | 3116 | if (!dir) |
3117 | { | 3117 | { |
3118 | ++errors; | 3118 | ++errors; |
@@ -3148,7 +3148,7 @@ try_dlopen (phandle, filename) | |||
3148 | int installed = 1; | 3148 | int installed = 1; |
3149 | 3149 | ||
3150 | /* extract the module name from the file name */ | 3150 | /* extract the module name from the file name */ |
3151 | name = LT_EMALLOC (char, ext - base_name + 1); | 3151 | name = LT_EGNUNET_malloc (char, ext - base_name + 1); |
3152 | if (!name) | 3152 | if (!name) |
3153 | { | 3153 | { |
3154 | ++errors; | 3154 | ++errors; |
@@ -3180,7 +3180,7 @@ try_dlopen (phandle, filename) | |||
3180 | { | 3180 | { |
3181 | const char *search_path; | 3181 | const char *search_path; |
3182 | 3182 | ||
3183 | LT_DLMUTEX_LOCK (); | 3183 | LT_DLGNUNET_mutex_lock (); |
3184 | search_path = user_search_path; | 3184 | search_path = user_search_path; |
3185 | if (search_path) | 3185 | if (search_path) |
3186 | file = find_file (user_search_path, base_name, &dir); | 3186 | file = find_file (user_search_path, base_name, &dir); |
@@ -3223,7 +3223,7 @@ try_dlopen (phandle, filename) | |||
3223 | } | 3223 | } |
3224 | 3224 | ||
3225 | line_len = LT_FILENAME_MAX; | 3225 | line_len = LT_FILENAME_MAX; |
3226 | line = LT_EMALLOC (char, line_len); | 3226 | line = LT_EGNUNET_malloc (char, line_len); |
3227 | if (!line) | 3227 | if (!line) |
3228 | { | 3228 | { |
3229 | fclose (file); | 3229 | fclose (file); |
@@ -3318,17 +3318,17 @@ try_dlopen (phandle, filename) | |||
3318 | } | 3318 | } |
3319 | 3319 | ||
3320 | fclose (file); | 3320 | fclose (file); |
3321 | LT_DLFREE (line); | 3321 | LT_DLGNUNET_free (line); |
3322 | 3322 | ||
3323 | /* allocate the handle */ | 3323 | /* allocate the handle */ |
3324 | *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); | 3324 | *phandle = (lt_dlhandle) LT_EGNUNET_malloc (struct lt_dlhandle_struct, 1); |
3325 | if (*phandle == 0) | 3325 | if (*phandle == 0) |
3326 | ++errors; | 3326 | ++errors; |
3327 | 3327 | ||
3328 | if (errors) | 3328 | if (errors) |
3329 | { | 3329 | { |
3330 | free_vars (dlname, old_name, libdir, deplibs); | 3330 | free_vars (dlname, old_name, libdir, deplibs); |
3331 | LT_DLFREE (*phandle); | 3331 | LT_DLGNUNET_free (*phandle); |
3332 | goto cleanup; | 3332 | goto cleanup; |
3333 | } | 3333 | } |
3334 | 3334 | ||
@@ -3354,7 +3354,7 @@ try_dlopen (phandle, filename) | |||
3354 | free_vars (dlname, old_name, libdir, deplibs); | 3354 | free_vars (dlname, old_name, libdir, deplibs); |
3355 | if (errors) | 3355 | if (errors) |
3356 | { | 3356 | { |
3357 | LT_DLFREE (*phandle); | 3357 | LT_DLGNUNET_free (*phandle); |
3358 | goto cleanup; | 3358 | goto cleanup; |
3359 | } | 3359 | } |
3360 | 3360 | ||
@@ -3366,7 +3366,7 @@ try_dlopen (phandle, filename) | |||
3366 | else | 3366 | else |
3367 | { | 3367 | { |
3368 | /* not a libtool module */ | 3368 | /* not a libtool module */ |
3369 | *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1); | 3369 | *phandle = (lt_dlhandle) LT_EGNUNET_malloc (struct lt_dlhandle_struct, 1); |
3370 | if (*phandle == 0) | 3370 | if (*phandle == 0) |
3371 | { | 3371 | { |
3372 | ++errors; | 3372 | ++errors; |
@@ -3400,7 +3400,7 @@ try_dlopen (phandle, filename) | |||
3400 | 3400 | ||
3401 | if (!newhandle) | 3401 | if (!newhandle) |
3402 | { | 3402 | { |
3403 | LT_DLFREE (*phandle); | 3403 | LT_DLGNUNET_free (*phandle); |
3404 | ++errors; | 3404 | ++errors; |
3405 | goto cleanup; | 3405 | goto cleanup; |
3406 | } | 3406 | } |
@@ -3414,7 +3414,7 @@ register_handle: | |||
3414 | (*phandle)->info.ref_count = 1; | 3414 | (*phandle)->info.ref_count = 1; |
3415 | LT_DLMEM_REASSIGN ((*phandle)->info.name, name); | 3415 | LT_DLMEM_REASSIGN ((*phandle)->info.name, name); |
3416 | 3416 | ||
3417 | LT_DLMUTEX_LOCK (); | 3417 | LT_DLGNUNET_mutex_lock (); |
3418 | (*phandle)->next = handles; | 3418 | (*phandle)->next = handles; |
3419 | handles = *phandle; | 3419 | handles = *phandle; |
3420 | LT_DLMUTEX_UNLOCK (); | 3420 | LT_DLMUTEX_UNLOCK (); |
@@ -3423,9 +3423,9 @@ register_handle: | |||
3423 | LT_DLMUTEX_SETERROR (saved_error); | 3423 | LT_DLMUTEX_SETERROR (saved_error); |
3424 | 3424 | ||
3425 | cleanup: | 3425 | cleanup: |
3426 | LT_DLFREE (dir); | 3426 | LT_DLGNUNET_free (dir); |
3427 | LT_DLFREE (name); | 3427 | LT_DLGNUNET_free (name); |
3428 | LT_DLFREE (canonical); | 3428 | LT_DLGNUNET_free (canonical); |
3429 | 3429 | ||
3430 | return errors; | 3430 | return errors; |
3431 | } | 3431 | } |
@@ -3494,7 +3494,7 @@ lt_dlopenext (filename) | |||
3494 | } | 3494 | } |
3495 | 3495 | ||
3496 | /* First try appending ARCHIVE_EXT. */ | 3496 | /* First try appending ARCHIVE_EXT. */ |
3497 | tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1); | 3497 | tmp = LT_EGNUNET_malloc (char, len + LT_STRLEN (archive_ext) + 1); |
3498 | if (!tmp) | 3498 | if (!tmp) |
3499 | return 0; | 3499 | return 0; |
3500 | 3500 | ||
@@ -3509,7 +3509,7 @@ lt_dlopenext (filename) | |||
3509 | in the module search path. */ | 3509 | in the module search path. */ |
3510 | if (handle || ((errors > 0) && !file_not_found ())) | 3510 | if (handle || ((errors > 0) && !file_not_found ())) |
3511 | { | 3511 | { |
3512 | LT_DLFREE (tmp); | 3512 | LT_DLGNUNET_free (tmp); |
3513 | return handle; | 3513 | return handle; |
3514 | } | 3514 | } |
3515 | 3515 | ||
@@ -3517,8 +3517,8 @@ lt_dlopenext (filename) | |||
3517 | /* Try appending SHLIB_EXT. */ | 3517 | /* Try appending SHLIB_EXT. */ |
3518 | if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext)) | 3518 | if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext)) |
3519 | { | 3519 | { |
3520 | LT_DLFREE (tmp); | 3520 | LT_DLGNUNET_free (tmp); |
3521 | tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1); | 3521 | tmp = LT_EGNUNET_malloc (char, len + LT_STRLEN (shlib_ext) + 1); |
3522 | if (!tmp) | 3522 | if (!tmp) |
3523 | return 0; | 3523 | return 0; |
3524 | 3524 | ||
@@ -3536,7 +3536,7 @@ lt_dlopenext (filename) | |||
3536 | with the current error message. */ | 3536 | with the current error message. */ |
3537 | if (handle || ((errors > 0) && !file_not_found ())) | 3537 | if (handle || ((errors > 0) && !file_not_found ())) |
3538 | { | 3538 | { |
3539 | LT_DLFREE (tmp); | 3539 | LT_DLGNUNET_free (tmp); |
3540 | return handle; | 3540 | return handle; |
3541 | } | 3541 | } |
3542 | #endif | 3542 | #endif |
@@ -3544,7 +3544,7 @@ lt_dlopenext (filename) | |||
3544 | /* Still here? Then we really did fail to locate any of the file | 3544 | /* Still here? Then we really did fail to locate any of the file |
3545 | names we tried. */ | 3545 | names we tried. */ |
3546 | LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); | 3546 | LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND)); |
3547 | LT_DLFREE (tmp); | 3547 | LT_DLGNUNET_free (tmp); |
3548 | return 0; | 3548 | return 0; |
3549 | } | 3549 | } |
3550 | 3550 | ||
@@ -3647,7 +3647,7 @@ lt_argz_insertdir (pargz, pargz_len, dirnam, dp) | |||
3647 | /* Prepend the directory name. */ | 3647 | /* Prepend the directory name. */ |
3648 | end_offset = end - dp->d_name; | 3648 | end_offset = end - dp->d_name; |
3649 | buf_len = dir_len + 1 + end_offset; | 3649 | buf_len = dir_len + 1 + end_offset; |
3650 | buf = LT_EMALLOC (char, 1 + buf_len); | 3650 | buf = LT_EGNUNET_malloc (char, 1 + buf_len); |
3651 | if (!buf) | 3651 | if (!buf) |
3652 | return ++errors; | 3652 | return ++errors; |
3653 | 3653 | ||
@@ -3662,7 +3662,7 @@ lt_argz_insertdir (pargz, pargz_len, dirnam, dp) | |||
3662 | if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) | 3662 | if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) |
3663 | ++errors; | 3663 | ++errors; |
3664 | 3664 | ||
3665 | LT_DLFREE (buf); | 3665 | LT_DLGNUNET_free (buf); |
3666 | 3666 | ||
3667 | return errors; | 3667 | return errors; |
3668 | } | 3668 | } |
@@ -3731,7 +3731,7 @@ foreachfile_callback (dirname, data1, data2) | |||
3731 | } | 3731 | } |
3732 | 3732 | ||
3733 | cleanup: | 3733 | cleanup: |
3734 | LT_DLFREE (argz); | 3734 | LT_DLGNUNET_free (argz); |
3735 | 3735 | ||
3736 | return is_done; | 3736 | return is_done; |
3737 | } | 3737 | } |
@@ -3795,7 +3795,7 @@ lt_dlclose (handle) | |||
3795 | lt_dlhandle cur, last; | 3795 | lt_dlhandle cur, last; |
3796 | int errors = 0; | 3796 | int errors = 0; |
3797 | 3797 | ||
3798 | LT_DLMUTEX_LOCK (); | 3798 | LT_DLGNUNET_mutex_lock (); |
3799 | 3799 | ||
3800 | /* check whether the handle is valid */ | 3800 | /* check whether the handle is valid */ |
3801 | last = cur = handles; | 3801 | last = cur = handles; |
@@ -3835,11 +3835,11 @@ lt_dlclose (handle) | |||
3835 | errors += unload_deplibs (handle); | 3835 | errors += unload_deplibs (handle); |
3836 | 3836 | ||
3837 | /* It is up to the callers to free the data itself. */ | 3837 | /* It is up to the callers to free the data itself. */ |
3838 | LT_DLFREE (handle->caller_data); | 3838 | LT_DLGNUNET_free (handle->caller_data); |
3839 | 3839 | ||
3840 | LT_DLFREE (handle->info.filename); | 3840 | LT_DLGNUNET_free (handle->info.filename); |
3841 | LT_DLFREE (handle->info.name); | 3841 | LT_DLGNUNET_free (handle->info.name); |
3842 | LT_DLFREE (handle); | 3842 | LT_DLGNUNET_free (handle); |
3843 | 3843 | ||
3844 | goto done; | 3844 | goto done; |
3845 | } | 3845 | } |
@@ -3888,7 +3888,7 @@ lt_dlsym (handle, symbol) | |||
3888 | } | 3888 | } |
3889 | else | 3889 | else |
3890 | { | 3890 | { |
3891 | sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); | 3891 | sym = LT_EGNUNET_malloc (char, lensym + LT_SYMBOL_OVERHEAD + 1); |
3892 | if (!sym) | 3892 | if (!sym) |
3893 | { | 3893 | { |
3894 | LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); | 3894 | LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW)); |
@@ -3923,7 +3923,7 @@ lt_dlsym (handle, symbol) | |||
3923 | { | 3923 | { |
3924 | if (sym != lsym) | 3924 | if (sym != lsym) |
3925 | { | 3925 | { |
3926 | LT_DLFREE (sym); | 3926 | LT_DLGNUNET_free (sym); |
3927 | } | 3927 | } |
3928 | return address; | 3928 | return address; |
3929 | } | 3929 | } |
@@ -3944,7 +3944,7 @@ lt_dlsym (handle, symbol) | |||
3944 | address = handle->loader->find_sym (data, handle->module, sym); | 3944 | address = handle->loader->find_sym (data, handle->module, sym); |
3945 | if (sym != lsym) | 3945 | if (sym != lsym) |
3946 | { | 3946 | { |
3947 | LT_DLFREE (sym); | 3947 | LT_DLGNUNET_free (sym); |
3948 | } | 3948 | } |
3949 | 3949 | ||
3950 | return address; | 3950 | return address; |
@@ -4027,8 +4027,8 @@ lt_dlpath_insertdir (ppath, before, dir) | |||
4027 | LT_DLMEM_REASSIGN (*ppath, argz); | 4027 | LT_DLMEM_REASSIGN (*ppath, argz); |
4028 | 4028 | ||
4029 | cleanup: | 4029 | cleanup: |
4030 | LT_DLFREE (canonical); | 4030 | LT_DLGNUNET_free (canonical); |
4031 | LT_DLFREE (argz); | 4031 | LT_DLGNUNET_free (argz); |
4032 | 4032 | ||
4033 | return errors; | 4033 | return errors; |
4034 | } | 4034 | } |
@@ -4041,7 +4041,7 @@ lt_dladdsearchdir (search_dir) | |||
4041 | 4041 | ||
4042 | if (search_dir && *search_dir) | 4042 | if (search_dir && *search_dir) |
4043 | { | 4043 | { |
4044 | LT_DLMUTEX_LOCK (); | 4044 | LT_DLGNUNET_mutex_lock (); |
4045 | if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) | 4045 | if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) |
4046 | ++errors; | 4046 | ++errors; |
4047 | LT_DLMUTEX_UNLOCK (); | 4047 | LT_DLMUTEX_UNLOCK (); |
@@ -4059,7 +4059,7 @@ lt_dlinsertsearchdir (before, search_dir) | |||
4059 | 4059 | ||
4060 | if (before) | 4060 | if (before) |
4061 | { | 4061 | { |
4062 | LT_DLMUTEX_LOCK (); | 4062 | LT_DLGNUNET_mutex_lock (); |
4063 | if ((before < user_search_path) | 4063 | if ((before < user_search_path) |
4064 | || (before >= user_search_path + LT_STRLEN (user_search_path))) | 4064 | || (before >= user_search_path + LT_STRLEN (user_search_path))) |
4065 | { | 4065 | { |
@@ -4072,7 +4072,7 @@ lt_dlinsertsearchdir (before, search_dir) | |||
4072 | 4072 | ||
4073 | if (search_dir && *search_dir) | 4073 | if (search_dir && *search_dir) |
4074 | { | 4074 | { |
4075 | LT_DLMUTEX_LOCK (); | 4075 | LT_DLGNUNET_mutex_lock (); |
4076 | if (lt_dlpath_insertdir (&user_search_path, | 4076 | if (lt_dlpath_insertdir (&user_search_path, |
4077 | (char *) before, search_dir) != 0) | 4077 | (char *) before, search_dir) != 0) |
4078 | { | 4078 | { |
@@ -4090,8 +4090,8 @@ lt_dlsetsearchpath (search_path) | |||
4090 | { | 4090 | { |
4091 | int errors = 0; | 4091 | int errors = 0; |
4092 | 4092 | ||
4093 | LT_DLMUTEX_LOCK (); | 4093 | LT_DLGNUNET_mutex_lock (); |
4094 | LT_DLFREE (user_search_path); | 4094 | LT_DLGNUNET_free (user_search_path); |
4095 | LT_DLMUTEX_UNLOCK (); | 4095 | LT_DLMUTEX_UNLOCK (); |
4096 | 4096 | ||
4097 | if (!search_path || !LT_STRLEN (search_path)) | 4097 | if (!search_path || !LT_STRLEN (search_path)) |
@@ -4099,7 +4099,7 @@ lt_dlsetsearchpath (search_path) | |||
4099 | return errors; | 4099 | return errors; |
4100 | } | 4100 | } |
4101 | 4101 | ||
4102 | LT_DLMUTEX_LOCK (); | 4102 | LT_DLGNUNET_mutex_lock (); |
4103 | if (canonicalize_path (search_path, &user_search_path) != 0) | 4103 | if (canonicalize_path (search_path, &user_search_path) != 0) |
4104 | ++errors; | 4104 | ++errors; |
4105 | LT_DLMUTEX_UNLOCK (); | 4105 | LT_DLMUTEX_UNLOCK (); |
@@ -4112,7 +4112,7 @@ lt_dlgetsearchpath () | |||
4112 | { | 4112 | { |
4113 | const char *saved_path; | 4113 | const char *saved_path; |
4114 | 4114 | ||
4115 | LT_DLMUTEX_LOCK (); | 4115 | LT_DLGNUNET_mutex_lock (); |
4116 | saved_path = user_search_path; | 4116 | saved_path = user_search_path; |
4117 | LT_DLMUTEX_UNLOCK (); | 4117 | LT_DLMUTEX_UNLOCK (); |
4118 | 4118 | ||
@@ -4184,7 +4184,7 @@ lt_dlforeach (func, data) | |||
4184 | int errors = 0; | 4184 | int errors = 0; |
4185 | lt_dlhandle cur; | 4185 | lt_dlhandle cur; |
4186 | 4186 | ||
4187 | LT_DLMUTEX_LOCK (); | 4187 | LT_DLGNUNET_mutex_lock (); |
4188 | 4188 | ||
4189 | cur = handles; | 4189 | cur = handles; |
4190 | while (cur) | 4190 | while (cur) |
@@ -4210,7 +4210,7 @@ lt_dlcaller_register () | |||
4210 | static lt_dlcaller_id last_caller_id = 0; | 4210 | static lt_dlcaller_id last_caller_id = 0; |
4211 | int result; | 4211 | int result; |
4212 | 4212 | ||
4213 | LT_DLMUTEX_LOCK (); | 4213 | LT_DLGNUNET_mutex_lock (); |
4214 | result = ++last_caller_id; | 4214 | result = ++last_caller_id; |
4215 | LT_DLMUTEX_UNLOCK (); | 4215 | LT_DLMUTEX_UNLOCK (); |
4216 | 4216 | ||
@@ -4229,7 +4229,7 @@ lt_dlcaller_set_data (key, handle, data) | |||
4229 | 4229 | ||
4230 | /* This needs to be locked so that the caller data can be updated | 4230 | /* This needs to be locked so that the caller data can be updated |
4231 | simultaneously by different threads. */ | 4231 | simultaneously by different threads. */ |
4232 | LT_DLMUTEX_LOCK (); | 4232 | LT_DLGNUNET_mutex_lock (); |
4233 | 4233 | ||
4234 | if (handle->caller_data) | 4234 | if (handle->caller_data) |
4235 | while (handle->caller_data[n_elements].key) | 4235 | while (handle->caller_data[n_elements].key) |
@@ -4281,7 +4281,7 @@ lt_dlcaller_get_data (key, handle) | |||
4281 | 4281 | ||
4282 | /* This needs to be locked so that the caller data isn't updated by | 4282 | /* This needs to be locked so that the caller data isn't updated by |
4283 | another thread part way through this function. */ | 4283 | another thread part way through this function. */ |
4284 | LT_DLMUTEX_LOCK (); | 4284 | LT_DLGNUNET_mutex_lock (); |
4285 | 4285 | ||
4286 | /* Locate the index of the element with a matching KEY. */ | 4286 | /* Locate the index of the element with a matching KEY. */ |
4287 | { | 4287 | { |
@@ -4324,7 +4324,7 @@ lt_dlloader_add (place, dlloader, loader_name) | |||
4324 | } | 4324 | } |
4325 | 4325 | ||
4326 | /* Create a new dlloader node with copies of the user callbacks. */ | 4326 | /* Create a new dlloader node with copies of the user callbacks. */ |
4327 | node = LT_EMALLOC (lt_dlloader, 1); | 4327 | node = LT_EGNUNET_malloc (lt_dlloader, 1); |
4328 | if (!node) | 4328 | if (!node) |
4329 | return 1; | 4329 | return 1; |
4330 | 4330 | ||
@@ -4337,7 +4337,7 @@ lt_dlloader_add (place, dlloader, loader_name) | |||
4337 | node->find_sym = dlloader->find_sym; | 4337 | node->find_sym = dlloader->find_sym; |
4338 | node->dlloader_data = dlloader->dlloader_data; | 4338 | node->dlloader_data = dlloader->dlloader_data; |
4339 | 4339 | ||
4340 | LT_DLMUTEX_LOCK (); | 4340 | LT_DLGNUNET_mutex_lock (); |
4341 | if (!loaders) | 4341 | if (!loaders) |
4342 | { | 4342 | { |
4343 | /* If there are no loaders, NODE becomes the list! */ | 4343 | /* If there are no loaders, NODE becomes the list! */ |
@@ -4400,7 +4400,7 @@ lt_dlloader_remove (loader_name) | |||
4400 | return 1; | 4400 | return 1; |
4401 | } | 4401 | } |
4402 | 4402 | ||
4403 | LT_DLMUTEX_LOCK (); | 4403 | LT_DLGNUNET_mutex_lock (); |
4404 | 4404 | ||
4405 | /* Fail if there are any open modules which use this loader. */ | 4405 | /* Fail if there are any open modules which use this loader. */ |
4406 | for (handle = handles; handle; handle = handle->next) | 4406 | for (handle = handles; handle; handle = handle->next) |
@@ -4439,7 +4439,7 @@ lt_dlloader_remove (loader_name) | |||
4439 | errors = place->dlloader_exit (place->dlloader_data); | 4439 | errors = place->dlloader_exit (place->dlloader_data); |
4440 | } | 4440 | } |
4441 | 4441 | ||
4442 | LT_DLFREE (place); | 4442 | LT_DLGNUNET_free (place); |
4443 | 4443 | ||
4444 | done: | 4444 | done: |
4445 | LT_DLMUTEX_UNLOCK (); | 4445 | LT_DLMUTEX_UNLOCK (); |
@@ -4453,7 +4453,7 @@ lt_dlloader_next (place) | |||
4453 | { | 4453 | { |
4454 | lt_dlloader *next; | 4454 | lt_dlloader *next; |
4455 | 4455 | ||
4456 | LT_DLMUTEX_LOCK (); | 4456 | LT_DLGNUNET_mutex_lock (); |
4457 | next = place ? place->next : loaders; | 4457 | next = place ? place->next : loaders; |
4458 | LT_DLMUTEX_UNLOCK (); | 4458 | LT_DLMUTEX_UNLOCK (); |
4459 | 4459 | ||
@@ -4468,7 +4468,7 @@ lt_dlloader_name (place) | |||
4468 | 4468 | ||
4469 | if (place) | 4469 | if (place) |
4470 | { | 4470 | { |
4471 | LT_DLMUTEX_LOCK (); | 4471 | LT_DLGNUNET_mutex_lock (); |
4472 | name = place ? place->loader_name : 0; | 4472 | name = place ? place->loader_name : 0; |
4473 | LT_DLMUTEX_UNLOCK (); | 4473 | LT_DLMUTEX_UNLOCK (); |
4474 | } | 4474 | } |
@@ -4488,7 +4488,7 @@ lt_dlloader_data (place) | |||
4488 | 4488 | ||
4489 | if (place) | 4489 | if (place) |
4490 | { | 4490 | { |
4491 | LT_DLMUTEX_LOCK (); | 4491 | LT_DLGNUNET_mutex_lock (); |
4492 | data = place ? &(place->dlloader_data) : 0; | 4492 | data = place ? &(place->dlloader_data) : 0; |
4493 | LT_DLMUTEX_UNLOCK (); | 4493 | LT_DLMUTEX_UNLOCK (); |
4494 | } | 4494 | } |
@@ -4506,7 +4506,7 @@ lt_dlloader_find (loader_name) | |||
4506 | { | 4506 | { |
4507 | lt_dlloader *place = 0; | 4507 | lt_dlloader *place = 0; |
4508 | 4508 | ||
4509 | LT_DLMUTEX_LOCK (); | 4509 | LT_DLGNUNET_mutex_lock (); |
4510 | for (place = loaders; place; place = place->next) | 4510 | for (place = loaders; place; place = place->next) |
4511 | { | 4511 | { |
4512 | if (strcmp (place->loader_name, loader_name) == 0) | 4512 | if (strcmp (place->loader_name, loader_name) == 0) |