Changeset 8630748 in mainline


Ignore:
Timestamp:
2020-06-24T22:43:00Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
78445be8
Parents:
62018a0
Message:

Handle attempt to launch second display server gracefully

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/fb/kfb/port.c

    r62018a0 r8630748  
    377377                assert(gc_id == 42);
    378378
     379                if (kfb->addr != AS_AREA_ANY) {
     380                        /* This means there already is a GC connection */
     381                        async_answer_0(icall, EBUSY);
     382                        return;
     383                }
     384
    379385                rc = physmem_map(kfb->paddr + kfb->offset,
    380386                    ALIGN_UP(kfb->size, PAGE_SIZE) >> PAGE_WIDTH,
     
    392398                rc = physmem_unmap(kfb->addr);
    393399                if (rc == EOK)
    394                         kfb->addr = NULL;
     400                        kfb->addr = AS_AREA_ANY;
    395401        }
    396402
    397403        return;
    398404error:
    399         if (kfb->addr != NULL) {
     405        if (kfb->addr != AS_AREA_ANY) {
    400406                if (physmem_unmap(kfb->addr) == EOK)
    401                         kfb->addr = NULL;
     407                        kfb->addr = AS_AREA_ANY;
    402408        }
    403409
  • uspace/srv/hid/display/main.c

    r62018a0 r8630748  
    121121                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server: %s.", str_error(rc));
    122122                rc = EEXIST;
     123                goto error;
    123124        }
    124125
  • uspace/srv/hid/display/output.c

    r62018a0 r8630748  
    163163        fibril_mutex_unlock(&output->lock);
    164164
     165        /* Fail if we did not open at least one device */
     166        if (list_empty(&output->ddevs)) {
     167                log_msg(LOG_DEFAULT, LVL_ERROR, "No output device found.");
     168                return ENOENT;
     169        }
     170
    165171        return rc;
    166172}
Note: See TracChangeset for help on using the changeset viewer.