-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Harry,

I looked over your patch.
* perhaps you should have configure detect __inline or inline. Some
platforms do not understand plain 'inline' I believe.
* the volatile keyword is needed because the signal handler sets this
variable, then wakes up the eventloop. The eventloop reads the variable.
Thus this variable is volatile for the eventloop, since a signal handler
can change it at any time. Could you please add it back.

Best regards,
   Wouter

Harry Kao wrote:
> Here's a patch against svn trunk to make libevent compile under
> Solaris using Sun Studio.  The main changes are:
> 
>   - Changed __inline to inline.
>   - Changed u_intX_t to uintX_t.  This was changed in event_rpcgen.py
>     as well.  I don't use that script so I hope this was the right
>     thing to do...
>   - Added code to configure.in to detect the libraries needed to link
>     in socket code.  (This adds -lnsl -lresolv on Solaris.)
>   - Fixed #includes in devpoll.c and evsignal.h to pull in required
>     headers.
>   - Removed volatile keyword from evsignal_info.evsignal_caught.  I'm
>     not sure why that was volatile in the first place.
> 
> It still doesn't build very cleanly, but at least it builds...  I've
> done limited testing on solaris-amd64, linux-amd64, linux-i386,
> mac-intel, and mac-ppc.  I hope that more experienced eyes can look
> this over and make sure that I haven't broken anything.  Thanks!
> 
> Harry
> 
> Index: evsignal.h
> ===================================================================
> --- evsignal.h        (revision 353)
> +++ evsignal.h        (working copy)
> @@ -27,12 +27,14 @@
>  #ifndef _EVSIGNAL_H_
>  #define _EVSIGNAL_H_
>  
> +#include <signal.h>
> +
>  struct evsignal_info {
>       struct event_list signalqueue;
>       struct event ev_signal;
>       int ev_signal_pair[2];
>       int ev_signal_added;
> -     volatile sig_atomic_t evsignal_caught;
> +     sig_atomic_t evsignal_caught;
>       sig_atomic_t evsigcaught[NSIG];
>  };
>  void evsignal_init(struct event_base *);

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFGOtDUkDLqNwOhpPgRAvlmAJ9RJ9QvfFT4yxkwe8AP5980kANUPgCePuR1
Y+ujgTyLTAx9Mz5MbHNTBl8=
=hWlX
-----END PGP SIGNATURE-----
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to