pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [HEADS UP] packages not supporting destdir



On Mon, Apr 02, 2012 at 07:58:50AM +0200, Alistair Crooks wrote:
> On Mon, Apr 02, 2012 at 12:26:50AM +0200, Onno van der Linden wrote:
> > On Sun, Apr 01, 2012 at 02:01:54PM -0700, Hisashi T Fujinaka wrote:
> > > 
> > > I use csup and it tends to hang for some reason, like it was opening
> > > sockets without closing them or spawning threads without killing them. I
> > > haven't looked into it that carefully.
> > 
> > See pkg/45131 ("csup hangs while trying to exit")
> > for a quick and dirty workaround and a comment
> > ("libpthread/pthread_cancelstub.c needs an
> >  additional entry for sigwait()") on where it really
> > should be fixed.
> 
> Thanks for the info - much appreciated.

I attached the following diff to PR 45131. Hisashi T Fujinaka kindly tested it,
and reports that it fixes csup. I'd like some more eyeballs on it, please.

Many thanks,
Alistair
Index: pthread_cancelstub.c
===================================================================
RCS file: /cvsroot/src/lib/libpthread/pthread_cancelstub.c,v
retrieving revision 1.35
diff -u -r1.35 pthread_cancelstub.c
--- pthread_cancelstub.c        22 Apr 2011 14:18:34 -0000      1.35
+++ pthread_cancelstub.c        2 Apr 2012 22:45:57 -0000
@@ -58,6 +58,7 @@
 #include <sys/uio.h>
 #include <sys/wait.h>
 #include <aio.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <mqueue.h>
 #include <poll.h>
@@ -577,6 +578,7 @@
        pthread_t self;
        int retval;
        struct timespec tout, *tp;
+
        if (timeout) {
                tout = *timeout;
                tp = &tout;
@@ -591,6 +593,28 @@
        return retval;
 }
 
+int                                                                            
                                      
+sigwait(const sigset_t * __restrict set, int * __restrict sig)
+{
+       pthread_t       self;
+       int             saved_errno;
+       int             new_errno;
+       int             retval;
+
+       self = pthread__self();
+       saved_errno = errno;
+       TESTCANCEL(self);
+       retval = ____sigtimedwait50(set, NULL, NULL);
+       TESTCANCEL(self);
+       new_errno = errno;
+       errno = saved_errno;
+       if (retval < 0) {
+               return new_errno;
+       }
+       *sig = retval;
+       return 0;
+}
+
 __strong_alias(_close, close)
 __strong_alias(_fcntl, fcntl)
 __strong_alias(_fdatasync, fdatasync)
@@ -608,6 +632,7 @@
 __strong_alias(_pwrite, pwrite)
 __strong_alias(_read, read)
 __strong_alias(_readv, readv)
+__strong_alias(_sigwait, sigwait)
 __strong_alias(_write, write)
 __strong_alias(_writev, writev)
 


Home | Main Index | Thread Index | Old Index