bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/9] startup: remove unused function run_for_real


From: Justus Winter
Subject: [PATCH 5/9] startup: remove unused function run_for_real
Date: Mon, 23 Sep 2013 13:03:27 +0200

* startup/startup.c (run_for_real): Remove function.
---
 startup/startup.c |   89 -----------------------------------------------------
 1 file changed, 89 deletions(-)

diff --git a/startup/startup.c b/startup/startup.c
index f54e650..a569fe2 100644
--- a/startup/startup.c
+++ b/startup/startup.c
@@ -405,95 +405,6 @@ run (const char *server, mach_port_t *ports, task_t *task)
      so we can crash if we don't make it to a fully bootstrapped Hurd.  */
   request_dead_name (*task);
 }
-
-/* Run FILENAME as root with ARGS as its argv (length ARGLEN).  Return
-   the task that we started.  If CTTY is set, then make that the
-   controlling terminal of the new process and put it in its own login
-   collection.  If SETSID is set, put it in a new session.  Return
-   0 if the task was not created successfully. */
-pid_t
-run_for_real (char *filename, char *args, int arglen, mach_port_t ctty,
-             int setsid)
-{
-  file_t file;
-  error_t err;
-  task_t task;
-  char *progname;
-  int pid;
-
-#if 0
-  char buf[512];
-  do
-    {
-      printf ("File name [%s]: ", filename);
-      if (getstring (buf, sizeof (buf)) && *buf)
-       filename = buf;
-      file = file_name_lookup (filename, O_EXEC, 0);
-      if (file == MACH_PORT_NULL)
-       error (0, errno, "%s", filename);
-    }
-  while (file == MACH_PORT_NULL);
-#else
-  file = file_name_lookup (filename, O_EXEC, 0);
-  if (file == MACH_PORT_NULL)
-    {
-      error (0, errno, "%s", filename);
-      return 0;
-    }
-#endif
-
-  task_create (mach_task_self (),
-#ifdef KERN_INVALID_LEDGER
-              NULL, 0, /* OSF Mach */
-#endif
-              0, &task);
-  proc_child (procserver, task);
-  proc_task2pid (procserver, task, &pid);
-  proc_task2proc (procserver, task, &default_ports[INIT_PORT_PROC]);
-  proc_mark_exec (default_ports[INIT_PORT_PROC]);
-  if (setsid)
-    proc_setsid (default_ports[INIT_PORT_PROC]);
-  if (ctty != MACH_PORT_NULL)
-    {
-      term_getctty (ctty, &default_ports[INIT_PORT_CTTYID]);
-      io_mod_owner (ctty, -pid);
-      proc_make_login_coll (default_ports[INIT_PORT_PROC]);
-    }
-  if (bootstrap_args & RB_KDB)
-    {
-      printf ("Pausing for %s\n", filename);
-      getchar ();
-    }
-  progname = strrchr (filename, '/');
-  if (progname)
-    ++progname;
-  else
-    progname = filename;
-  err = file_exec (file, task, 0,
-                  args, arglen,
-                  startup_envz, startup_envz_len,
-                  default_dtable, MACH_MSG_TYPE_COPY_SEND, 3,
-                  default_ports, MACH_MSG_TYPE_COPY_SEND,
-                  INIT_PORT_MAX,
-                  default_ints, INIT_INT_MAX,
-                  NULL, 0, NULL, 0);
-  mach_port_deallocate (mach_task_self (), default_ports[INIT_PORT_PROC]);
-  mach_port_deallocate (mach_task_self (), task);
-  if (ctty != MACH_PORT_NULL)
-    {
-      mach_port_deallocate (mach_task_self (),
-                           default_ports[INIT_PORT_CTTYID]);
-      default_ports[INIT_PORT_CTTYID] = MACH_PORT_NULL;
-    }
-  mach_port_deallocate (mach_task_self (), file);
-  if (err)
-    {
-      error (0, err, "Cannot execute %s", filename);
-      return 0;
-    }
-  return pid;
-}
-
 
 /** Main program and setup **/
 
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]