Ver código fonte

Don't abort in |init_once| if |fcntl| returns ENOSYS

Native Client doesn't support fcntl natively and its default
implemention just returns ENOSYS.

Change-Id: Id8615e2f6f0a75a1140f8efd75afde471ccdf466
Reviewed-on: https://boringssl-review.googlesource.com/6721
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
Sam Clegg 8 anos atrás
committed by Adam Langley
pai
commit
dca63cfa75
1 arquivos alterados com 9 adições e 5 exclusões
  1. +9
    -5
      crypto/rand/urandom.c

+ 9
- 5
crypto/rand/urandom.c Ver arquivo

@@ -83,11 +83,15 @@ static void init_once(void) {

int flags = fcntl(fd, F_GETFD);
if (flags == -1) {
abort();
}
flags |= FD_CLOEXEC;
if (fcntl(fd, F_SETFD, flags) == -1) {
abort();
/* Native Client doesn't implement |fcntl|. */
if (errno != ENOSYS) {
abort();
}
} else {
flags |= FD_CLOEXEC;
if (fcntl(fd, F_SETFD, flags) == -1) {
abort();
}
}
urandom_fd = fd;
}


Carregando…
Cancelar
Salvar