[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gc.m4 and hard failure
From: |
Ralf Wildenhues |
Subject: |
Re: gc.m4 and hard failure |
Date: |
Tue, 7 Mar 2006 17:44:40 +0100 |
User-agent: |
Mutt/1.5.11 |
Hi Simon,
* Simon Josefsson wrote on Tue, Mar 07, 2006 at 02:17:13PM CET:
> Simon Josefsson <address@hidden> writes:
> > Ralf Wildenhues <address@hidden> writes:
> >
> >> It would be great if the gc.m4 module could be taught not to fail when
> >> no random devices exist (as seen on hppa2.0-hp-hpux10.20). Passing
> >>
> >> --disable-random-device --disable-pseudo-random-device \
> >> --disable-nonce-device
> >>
> >> did not help.
> > I agree. The functions using those random devices can return an
> > error, so I suggest turning the errors into warnings, and make the
> > code properly return an error if the device is unavailable. I think
> > the code already does this though.
>
> I have installed the patch below. It separate the random stuff into a
> new module, gc-random. It also turn the errors into warnings.
> What do you think?
Better, thanks. But
--disable-random-device (--enable-random-devide=no)
could IMVHO still be given a useful meaning, which it currently does not
have. Since I don't actually use this code in any project, I can't tell
you how realistic this usage case would be.
Meanwhile, I noted another small issue, see below.
Cheers,
Ralf
> Index: m4/gc-random.m4
> ===================================================================
> RCS file: m4/gc-random.m4
> diff -N m4/gc-random.m4
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ m4/gc-random.m4 7 Mar 2006 13:15:33 -0000
> @@ -0,0 +1,81 @@
> +# gc-random.m4 serial 1
> +dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
> +dnl This file is free software; the Free Software Foundation
> +dnl gives unlimited permission to copy and/or distribute it,
> +dnl with or without modifications, as long as this notice is preserved.
> +
> +AC_DEFUN([gl_GC_RANDOM],
> +[
> + # Devices with randomness.
> + # FIXME: Are these the best defaults?
> +
> + case "${target}" in
Why do you use $target? Are you putting this in a compiler?
It'd be good to precede with
AC_REQUIRE([AC_CANONICAL_HOST])dnl
and then you really want
case $host in
> + *-openbsd*)
*-*-openbsd*)
You could also just test $host_os, and then match
openbsd*)
only.
> + NAME_OF_RANDOM_DEVICE="/dev/srandom"
> + NAME_OF_PSEUDO_RANDOM_DEVICE="/dev/prandom"
> + NAME_OF_NONCE_DEVICE="/dev/urandom"
> + ;;
*snip*
- gc.m4 and hard failure, Ralf Wildenhues, 2006/03/03
- Re: gc.m4 and hard failure, Simon Josefsson, 2006/03/04
- Re: gc.m4 and hard failure, Simon Josefsson, 2006/03/07
- Re: gc.m4 and hard failure,
Ralf Wildenhues <=
- Re: gc.m4 and hard failure, Simon Josefsson, 2006/03/08
- Re: gc.m4 and hard failure, Ralf Wildenhues, 2006/03/08
- Re: gc.m4 and hard failure, Simon Josefsson, 2006/03/08
- Re: gc.m4 and hard failure, Ralf Wildenhues, 2006/03/08
- Re: gc.m4 and hard failure, Simon Josefsson, 2006/03/08
- Re: gc.m4 and hard failure, Paul Eggert, 2006/03/10