changeset 1105:f80524d00a2c draft

bug fix.
author tkaito
date Sun, 02 Jan 2011 21:09:21 +0900
parents 3e7cb5546075
children a1c5d7c51db0 c9d0683c9b39
files TaskManager/kernel/main.cc
diffstat 1 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/main.cc	Sun Jan 02 20:59:12 2011 +0900
+++ b/TaskManager/kernel/main.cc	Sun Jan 02 21:09:21 2011 +0900
@@ -35,6 +35,9 @@
 {
     int machineNum = 1;
     int speIdle = 0;
+
+    TaskManager *manager = new TaskManager(machineNum);
+
     for (int i = 1; argv[i]; ++i) {
         if (strcmp(argv[i], "-cpu") == 0) {
             machineNum = atoi(argv[++i]);
@@ -42,19 +45,22 @@
 	    profile = 1;
         } else if (strcmp(argv[i], "-speidle") == 0) {
 	    speIdle = atoi(argv[++i]);
-	} else if (strcmp(argv[i], "-help") == 0) {
-	    if (usr_help_str) {
-		manager->get_scheduler()->printf("%s", usr_help_str);
-	    }
-	    manager->get_scheduler()->printf("%s", help_str);	    
-	    return EXIT_SUCCESS;
-        }
+	}
 
     }
 
-    TaskManager *manager = new TaskManager(machineNum);
     manager->init(speIdle);
 
+    for (int i = 1; argv[i]; ++i) {
+        if (strcmp(argv[i], "-help") == 0) {
+	  if (usr_help_str) {
+	    manager->get_scheduler()->printf("%s", usr_help_str);
+	  }
+	  manager->get_scheduler()->printf("%s", help_str);	    
+	  return EXIT_SUCCESS;
+        }
+    }
+
     manager->set_TMend(defaultTMend);
 
     if (profile)