/[baselayout]/trunk/src/rc.c
Gentoo

Diff of /trunk/src/rc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2683 Revision 2684
34#include "strlist.h" 34#include "strlist.h"
35 35
36#define INITSH RC_LIBDIR "sh/init.sh" 36#define INITSH RC_LIBDIR "sh/init.sh"
37#define INITEARLYSH RC_LIBDIR "sh/init-early.sh" 37#define INITEARLYSH RC_LIBDIR "sh/init-early.sh"
38#define HALTSH RC_INITDIR "halt.sh" 38#define HALTSH RC_INITDIR "halt.sh"
39#define SULOGIN "/sbin/sulogin"
39 40
40#define RC_SVCDIR_STARTING RC_SVCDIR "starting/" 41#define RC_SVCDIR_STARTING RC_SVCDIR "starting/"
41#define RC_SVCDIR_INACTIVE RC_SVCDIR "inactive/" 42#define RC_SVCDIR_INACTIVE RC_SVCDIR "inactive/"
42#define RC_SVCDIR_STARTED RC_SVCDIR "started/" 43#define RC_SVCDIR_STARTED RC_SVCDIR "started/"
43#define RC_SVCDIR_COLDPLUGGED RC_SVCDIR "coldplugged/" 44#define RC_SVCDIR_COLDPLUGGED RC_SVCDIR "coldplugged/"
391 392
392 newenv = rc_filter_env (); 393 newenv = rc_filter_env ();
393 394
394 if (cont) { 395 if (cont) {
395 int status = 0; 396 int status = 0;
397#ifdef __linux__
398 char *tty = ttyname (fileno (stdout));
399#endif
400
396 pid_t pid = vfork (); 401 pid_t pid = vfork ();
397 402
398 if (pid == -1) 403 if (pid == -1)
399 eerrorx ("%s: vfork: %s", applet, strerror (errno)); 404 eerrorx ("%s: vfork: %s", applet, strerror (errno));
400 if (pid == 0) { 405 if (pid == 0) {
401#ifdef __linux__ 406#ifdef __linux__
402 execle ("/sbin/sulogin", "/sbin/sulogin", (char *) NULL, newenv); 407 if (tty)
408 execle (SULOGIN, SULOGIN, tty, (char *) NULL, newenv);
409 else
410 execle (SULOGIN, SULOGIN, (char *) NULL, newenv);
411
403 eerror ("%s: unable to exec `/sbin/sulogin': %s", applet, 412 eerror ("%s: unable to exec `%s': %s", applet, SULOGIN,
404 strerror (errno)); 413 strerror (errno));
405#else 414#else
406 execle ("/bin/sh", "/bin/sh", (char *) NULL, newenv); 415 execle ("/bin/sh", "/bin/sh", (char *) NULL, newenv);
407 eerror ("%s: unable to exec `/bin/sh': %s", applet, 416 eerror ("%s: unable to exec `/bin/sh': %s", applet,
408 strerror (errno)); 417 strerror (errno));

Legend:
Removed from v.2683  
changed lines
  Added in v.2684

  ViewVC Help
Powered by ViewVC 1.1.20