diff options
Diffstat (limited to 'src/main/extractor_plugpath.c')
-rw-r--r-- | src/main/extractor_plugpath.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main/extractor_plugpath.c b/src/main/extractor_plugpath.c index 4374bc5..269061f 100644 --- a/src/main/extractor_plugpath.c +++ b/src/main/extractor_plugpath.c | |||
@@ -24,7 +24,6 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "plibc.h" | ||
28 | #include "extractor.h" | 27 | #include "extractor.h" |
29 | #include <dirent.h> | 28 | #include <dirent.h> |
30 | #include <sys/types.h> | 29 | #include <sys/types.h> |
@@ -103,7 +102,7 @@ get_path_from_proc_exe () | |||
103 | sizeof (fn), | 102 | sizeof (fn), |
104 | "/proc/%u/maps", | 103 | "/proc/%u/maps", |
105 | getpid ()); | 104 | getpid ()); |
106 | if (NULL != (f = FOPEN (fn, "r"))) | 105 | if (NULL != (f = fopen (fn, "r"))) |
107 | { | 106 | { |
108 | while (NULL != fgets (line, 1024, f)) | 107 | while (NULL != fgets (line, 1024, f)) |
109 | { | 108 | { |
@@ -419,7 +418,7 @@ append_to_dir (const char *path, | |||
419 | 418 | ||
420 | if (0 == (slen = strlen (path))) | 419 | if (0 == (slen = strlen (path))) |
421 | return NULL; | 420 | return NULL; |
422 | if (DIR_SEPARATOR == fname[0]) | 421 | if ('/' == fname[0]) |
423 | fname++; | 422 | fname++; |
424 | ret = malloc (slen + strlen (fname) + 2); | 423 | ret = malloc (slen + strlen (fname) + 2); |
425 | if (NULL == ret) | 424 | if (NULL == ret) |
@@ -476,9 +475,9 @@ get_installation_paths (EXTRACTOR_PathProcessor pp, | |||
476 | LOG_STRERROR ("strdup"); | 475 | LOG_STRERROR ("strdup"); |
477 | return; | 476 | return; |
478 | } | 477 | } |
479 | for (prefix = strtok_r (d, PATH_SEPARATOR_STR, &saveptr); | 478 | for (prefix = strtok_r (d, ":", &saveptr); |
480 | NULL != prefix; | 479 | NULL != prefix; |
481 | prefix = strtok_r (NULL, PATH_SEPARATOR_STR, &saveptr)) | 480 | prefix = strtok_r (NULL, ":", &saveptr)) |
482 | pp (pp_cls, prefix); | 481 | pp (pp_cls, prefix); |
483 | free (d); | 482 | free (d); |
484 | return; | 483 | return; |
@@ -551,9 +550,9 @@ find_plugin_in_path (void *cls, | |||
551 | 550 | ||
552 | if (NULL != sc->path) | 551 | if (NULL != sc->path) |
553 | return; | 552 | return; |
554 | if (NULL == (dir = OPENDIR (path))) | 553 | if (NULL == (dir = opendir (path))) |
555 | return; | 554 | return; |
556 | while (NULL != (ent = READDIR (dir))) | 555 | while (NULL != (ent = readdir (dir))) |
557 | { | 556 | { |
558 | if ('.' == ent->d_name[0]) | 557 | if ('.' == ent->d_name[0]) |
559 | continue; | 558 | continue; |
@@ -568,7 +567,7 @@ find_plugin_in_path (void *cls, | |||
568 | if (NULL == (sym = strdup (sym_name))) | 567 | if (NULL == (sym = strdup (sym_name))) |
569 | { | 568 | { |
570 | LOG_STRERROR ("strdup"); | 569 | LOG_STRERROR ("strdup"); |
571 | CLOSEDIR (dir); | 570 | closedir (dir); |
572 | return; | 571 | return; |
573 | } | 572 | } |
574 | dot = strchr (sym, '.'); | 573 | dot = strchr (sym, '.'); |
@@ -582,7 +581,7 @@ find_plugin_in_path (void *cls, | |||
582 | } | 581 | } |
583 | free (sym); | 582 | free (sym); |
584 | } | 583 | } |
585 | CLOSEDIR (dir); | 584 | closedir (dir); |
586 | } | 585 | } |
587 | 586 | ||
588 | 587 | ||