L4Re/OLD/e2fsserver

Changeset

135:69316b16eb95
2020-07-04 Paul Boddie raw files shortlog changelog graph Actually reserve a capability slot for the semaphore.
server/src/fs_accessor.cc (file)
     1.1 --- a/server/src/fs_accessor.cc	Thu Jun 25 23:39:24 2020 +0200
     1.2 +++ b/server/src/fs_accessor.cc	Sat Jul 04 01:19:52 2020 +0200
     1.3 @@ -117,8 +117,13 @@
     1.4  
     1.5      /* Create a semaphore and make the accessor initially available. */
     1.6  
     1.7 -    l4_factory_create(l4re_env()->factory, L4_PROTO_SEMAPHORE, _semaphore);
     1.8 -    l4_semaphore_up(_semaphore);
     1.9 +    _semaphore = l4re_util_cap_alloc();
    1.10 +
    1.11 +    if (l4_is_valid_cap(_semaphore))
    1.12 +    {
    1.13 +      l4_factory_create(l4re_env()->factory, L4_PROTO_SEMAPHORE, _semaphore);
    1.14 +      l4_semaphore_up(_semaphore);
    1.15 +    }
    1.16    }
    1.17  
    1.18    return attached;