Changeset c91c9fb in mainline


Ignore:
Timestamp:
2009-03-02T17:26:01Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
926d6ca
Parents:
6cef75da
Message:

remove console_wait() (this will be moved to libc)
mount only a single root filesystem, use IPC_FLAG_BLOCKING

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/init/init.c

    r6cef75da rc91c9fb  
    2828
    2929/** @addtogroup init Init
    30  * @brief       Init process for testing purposes.
     30 * @brief Init process for user space environment configuration.
    3131 * @{
    32  */ 
     32 */
    3333/**
    3434 * @file
     
    3737#include <stdio.h>
    3838#include <unistd.h>
     39#include <ipc/ipc.h>
    3940#include <vfs/vfs.h>
    4041#include <bool.h>
     
    4344#include <task.h>
    4445#include <malloc.h>
     46#include <macros.h>
    4547#include "init.h"
    4648#include "version.h"
    47 
    48 static void console_wait(void)
    49 {
    50         while (get_cons_phone() < 0)
    51                 usleep(50000);  // FIXME
    52 }
    5349
    5450static bool mount_fs(const char *fstype)
     
    5753       
    5854        while (rc < 0) {
    59                 rc = mount(fstype, "/", "initrd");
    60 
     55                rc = mount(fstype, "/", "initrd", IPC_FLAG_BLOCKING);
     56               
    6157                switch (rc) {
    6258                case EOK:
     
    7268                        printf(NAME ": Unknown filesystem type (%s)\n", fstype);
    7369                        return false;
    74                 default:
    75                         sleep(5);       // FIXME
    7670                }
    7771        }
     
    8377{
    8478        char *argv[2];
    85 
     79       
    8680        printf(NAME ": Spawning %s\n", fname);
    87 
     81       
    8882        argv[0] = fname;
    8983        argv[1] = NULL;
    90 
    91         if (task_spawn(fname, argv) != 0) {
    92                 /* Success */
    93                 sleep(1);
    94         }
     84       
     85        if (task_spawn(fname, argv))
     86                /* Add reasonable delay to avoid
     87                   intermixed klog output */
     88                usleep(10000);
     89        else
     90                printf(NAME ": Error spawning %s\n", fname);
    9591}
    9692
     
    9894{
    9995        info_print();
    100         sleep(5);       // FIXME
    10196       
    102         if (!mount_fs("tmpfs") && !mount_fs("fat")) {
     97        if (!mount_fs(STRING(RDFMT))) {
    10398                printf(NAME ": Exiting\n");
    10499                return -1;
Note: See TracChangeset for help on using the changeset viewer.