Changeset 470


Ignore:
Timestamp:
Feb 27, 2011, 12:33:13 AM (10 years ago)
Author:
khorben
Message:

Trying to start xynth directly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Apps/Unix/Sources/others/tools/oinit.c

    r384 r470  
    11/* $Id: oinit.c,v 1.1 2009/03/06 18:05:08 khorben Exp $ */
    2 /* Copyright (c) 2009 Pierre Pronchery <khorben@defora.org> */
     2/* Copyright (c) 2011 Pierre Pronchery <khorben@defora.org> */
    33/* This file is part of DeforaOS Unix others */
    44/* others is not free software; you can redistribute it and/or modify it under
     
    2626int main(void)
    2727{
    28         char shell[] = "/bin/sh";
     28        const char shell[] = "/bin/sh";
     29        char * const arg[] = { "sh", "-i", NULL };
     30        char * const argx[] = { "sh", "-c",
     31                "/usr/bin/xynth || /usr/bin/echo xynth failed; sh", NULL };
     32        char * const env[] = { "PATH=/usr/bin:/bin", NULL };
    2933
    3034        open("/dev/console", O_RDONLY);
    3135        open("/dev/console", O_WRONLY);
    3236        open("/dev/console", O_WRONLY);
    33         execl(shell, shell, "-i", NULL);
     37        execve(shell, argx, env);
     38        perror(shell);
     39        execve(shell, arg, env);
    3440        perror(shell);
    3541        return errno;
Note: See TracChangeset for help on using the changeset viewer.