[PATCH] fix xfwm4 crash on OpenBSD; time_t size problem

Stefan Sperling stsp at stsp.name
Sun Feb 9 21:39:25 CET 2014


On Sun, Feb 09, 2014 at 09:27:45AM -0800, Matthew Brush wrote:
> On 14-02-08 02:49 AM, Stefan Sperling wrote:
> >(code from libstartup-notification)
> >[[[
> >void
> >sn_startup_sequence_get_last_active_time (SnStartupSequence *sequence,
> >                                           time_t            *tv_sec,
> >                                           suseconds_t       *tv_usec)
> >{
> >   /* for now the same as get_initiated_time */
> >   if (tv_sec)
> >     *tv_sec = sequence->initiation_time.tv_sec;
> >   if (tv_usec)
> >     *tv_usec = sequence->initiation_time.tv_usec;
> >}
> >]]]
> >
> 
> http://cgit.freedesktop.org/startup-notification/tree/libsn/sn-monitor.c?id=bc7c6d2d285509c7fcd1899c866838bd278fab58#n388
> 
> It seems to be using long ints as well unlike above paste, but it sets those
> values from a struct timeval which does use time_t and suseconds_t. Maybe
> the pasted code is from a (correctly) patched libsn where the patch hasn't
> been upstreamed yet?

Ah, I didn't realise we had patches in there.
http://www.openbsd.org/cgi-bin/cvsweb/ports/devel/startup-notification/patches/patch-libsn_sn-monitor_c?rev=1.1;content-type=text%2Fplain

I'll try to push them upstream as well.
 
> >+--- src/startup_notification.c.orig	Sat Feb  8 11:08:22 2014
> >++++ src/startup_notification.c	Sat Feb  8 11:08:13 2014
> >+@@ -126,7 +126,8 @@ sn_collect_timed_out_foreach (void *element, void *dat
> >+ {
> >+     CollectTimedOutData *ctod;
> >+     SnStartupSequence *sequence;
> >+-    long tv_sec, tv_usec;
> >++    time_t tv_sec;
> >++    suseconds_t tv_usec;
> 
> Should it explicitly include <sys/types.h> (or whatever header) to make sure
> those types are still available if whoever currently includes it stops doing
> so?

sys/types.h is the right header to include, yes.


More information about the Xfce4-dev mailing list