Martin Storsjö <[email protected]> writes:

> From: "Ronald S. Bultje" <[email protected]>
>
> unistd.h is used for open/read/close, but if this header does not
> exist, there's probably no use in trying to open /dev/*random
> at all.
> ---
>  libavutil/random_seed.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
> index 51ca99b..8ee4cb7 100644
> --- a/libavutil/random_seed.c
> +++ b/libavutil/random_seed.c
> @@ -18,7 +18,11 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
>
> +#include "config.h"
> +
> +#if HAVE_UNISTD_H
>  #include <unistd.h>
> +#endif
>  #include <fcntl.h>
>  #include <math.h>
>  #include <time.h>
> @@ -27,6 +31,7 @@
>
>  static int read_random(uint32_t *dst, const char *file)
>  {
> +#if HAVE_UNISTD_H
>      int fd = open(file, O_RDONLY);
>      int err = -1;
>
> @@ -36,6 +41,9 @@ static int read_random(uint32_t *dst, const char *file)
>      close(fd);
>
>      return err;
> +#else
> +    return -1;
> +#endif
>  }
>
>  static uint32_t get_generic_seed(void)
> -- 

LGTM

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to