shm: Check `fcntl` return value

Adding seals to the `memfd_create()`'ed  file descriptor could
potentially fail.

Make sure to test the return value of the call to `fcntl` to place the

Fixes: f6753c11 - shm: Use memfd_create when possible
Signed-off-by: Olivier Fourdan <>
3 jobs for xshm-fcntl in 7 minutes and 12 seconds (queued for 2 seconds)