As a safety fallback allow the modifications of the library path to be
suppressed.

Signed-off-by: Andy Whitcroft <[EMAIL PROTECTED]>
---
 hugectl.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/hugectl.c b/hugectl.c
index 84ced31..6742637 100644
--- a/hugectl.c
+++ b/hugectl.c
@@ -117,6 +117,7 @@ void setup_environment(char *var, char *val)
 
 #define LONG_DRY_RUN   (LONG_BASE | 'd')
 
+#define LONG_NO_LIBRARY        (LONG_BASE | 'L')
 #define LONG_LIBRARY   (LONG_BASE | 'l')
 
 /*
@@ -242,6 +243,8 @@ int main(int argc, char** argv)
                {"dry-run",    no_argument, NULL, LONG_DRY_RUN},
                {"library-path",
                               required_argument, NULL, LONG_LIBRARY},
+               {"library-use-path",
+                              no_argument, NULL, LONG_NO_LIBRARY},
 
                {"disable",    no_argument, NULL, MAP_BASE|MAP_DISABLE},
                {"text",       no_argument, NULL, MAP_BASE|MAP_TEXT},
@@ -278,6 +281,11 @@ int main(int argc, char** argv)
                        opt_dry_run = 1;
                        break;
 
+               case LONG_NO_LIBRARY:
+                       opt_library = LIBRARY_DISABLE;
+                       DEBUG("using LD_LIBRARY_PATH to find library\n");
+                       break;
+
                case LONG_LIBRARY:
                        opt_library = optarg;
                        break;
@@ -296,7 +304,8 @@ int main(int argc, char** argv)
                exit(EXIT_FAILURE);
        }
 
-       library_path(opt_library);
+       if (opt_library != LIBRARY_DISABLE)
+               library_path(opt_library);
 
        if (opt_mappings)
                setup_mappings(opt_mappings);
-- 
1.5.6.GIT


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to