um: remove SIGHUP handler
[pandora-kernel.git] / arch / um / os-Linux / main.c
index 82c3778..fb2a97a 100644 (file)
@@ -73,12 +73,12 @@ static void install_fatal_handler(int sig)
        action.sa_handler = last_ditch_exit;
        if (sigaction(sig, &action, NULL) < 0) {
                printf("failed to install handler for signal %d - errno = %d\n",
-                      errno);
+                      sig, errno);
                exit(1);
        }
 }
 
-#define UML_LIB_PATH   ":/usr/lib/uml"
+#define UML_LIB_PATH   ":" OS_LIB_PATH "/uml"
 
 static void setup_env_path(void)
 {
@@ -92,7 +92,8 @@ static void setup_env_path(void)
         * just use the default + /usr/lib/uml
         */
        if (!old_path || (path_len = strlen(old_path)) == 0) {
-               putenv("PATH=:/bin:/usr/bin/" UML_LIB_PATH);
+               if (putenv("PATH=:/bin:/usr/bin/" UML_LIB_PATH))
+                       perror("couldn't putenv");
                return;
        }
 
@@ -100,15 +101,16 @@ static void setup_env_path(void)
        path_len += strlen("PATH=" UML_LIB_PATH) + 1;
        new_path = malloc(path_len);
        if (!new_path) {
-               perror("coudn't malloc to set a new PATH");
+               perror("couldn't malloc to set a new PATH");
                return;
        }
        snprintf(new_path, path_len, "PATH=%s" UML_LIB_PATH, old_path);
-       putenv(new_path);
+       if (putenv(new_path)) {
+               perror("couldn't putenv to set a new PATH");
+               free(new_path);
+       }
 }
 
-extern int uml_exitcode;
-
 extern void scan_elf_aux( char **envp);
 
 int __init main(int argc, char **argv, char **envp)
@@ -140,7 +142,6 @@ int __init main(int argc, char **argv, char **envp)
         */
        install_fatal_handler(SIGINT);
        install_fatal_handler(SIGTERM);
-       install_fatal_handler(SIGHUP);
 
        scan_elf_aux(envp);
 
@@ -197,7 +198,7 @@ void *__wrap_malloc(int size)
                return __real_malloc(size);
        else if (size <= UM_KERN_PAGE_SIZE)
                /* finding contiguous pages can be hard*/
-               ret = kmalloc(size, UM_GFP_KERNEL);
+               ret = uml_kmalloc(size, UM_GFP_KERNEL);
        else ret = vmalloc(size);
 
        /*