Ignore:
File:
1 edited

Legend:

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

    r1ab8539 r07b7c48  
    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        }
    4445       
    4546        struct timeval start;
    46         gettimeofday(&start, NULL);
     47        if (gettimeofday(&start, NULL) != 0) {
     48                err = "Failed getting the time";
     49                goto leave;
     50        }
    4751       
    4852        TPRINTF("Intensive computation shall be imagined (for %ds)...\n", DURATION_SECS);
     
    5054        while (true) {
    5155                struct timeval now;
    52                 gettimeofday(&now, NULL);
     56                if (gettimeofday(&now, NULL) != 0) {
     57                        err = "Failed getting the time";
     58                        goto leave;
     59                }
    5360               
    5461                if (tv_sub(&now, &start) >= DURATION_SECS * 1000000L)
     
    6370                }
    6471        }
    65        
     72
    6673        // FIXME - unless a key was pressed, the answer leaked as no one
    6774        // will wait for it.
    6875        // We cannot use async_forget() directly, though. Something like
    6976        // console_forget_pending_kbd_event() shall come here.
    70        
     77
    7178        TPRINTF("Terminating...\n");
    72        
     79
     80leave:
    7381        console_done(console);
    74        
     82
    7583        return err;
    7684}
Note: See TracChangeset for help on using the changeset viewer.