Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/ipc/starve.c

    r07b7c48 r1ab8539  
    4040        const char *err = NULL;
    4141        console_ctrl_t *console = console_init(stdin, stdout);
    42         if (console == NULL) {
     42        if (console == NULL)
    4343                return "Failed to init connection with console.";
    44         }
    4544       
    4645        struct timeval start;
    47         if (gettimeofday(&start, NULL) != 0) {
    48                 err = "Failed getting the time";
    49                 goto leave;
    50         }
     46        gettimeofday(&start, NULL);
    5147       
    5248        TPRINTF("Intensive computation shall be imagined (for %ds)...\n", DURATION_SECS);
     
    5450        while (true) {
    5551                struct timeval now;
    56                 if (gettimeofday(&now, NULL) != 0) {
    57                         err = "Failed getting the time";
    58                         goto leave;
    59                 }
     52                gettimeofday(&now, NULL);
    6053               
    6154                if (tv_sub(&now, &start) >= DURATION_SECS * 1000000L)
     
    7063                }
    7164        }
    72 
     65       
    7366        // FIXME - unless a key was pressed, the answer leaked as no one
    7467        // will wait for it.
    7568        // We cannot use async_forget() directly, though. Something like
    7669        // console_forget_pending_kbd_event() shall come here.
    77 
     70       
    7871        TPRINTF("Terminating...\n");
    79 
    80 leave:
     72       
    8173        console_done(console);
    82 
     74       
    8375        return err;
    8476}
Note: See TracChangeset for help on using the changeset viewer.