Обновление подмодулей
This commit is contained in:
parent
4519190768
commit
c418aa8df0
@ -1 +1 @@
|
|||||||
Subproject commit 186d67c4bbc2fa91ecfd837d753631610aff0b1d
|
Subproject commit 5c90828e4e189e78fce1d93bf1700519e7aff76c
|
@ -16,16 +16,16 @@ std::array< int, 2 > PosixSignalWatcherPrivate::mSockpair { { 0, 0 } };
|
|||||||
PosixSignalWatcherPrivate::~PosixSignalWatcherPrivate() = default;
|
PosixSignalWatcherPrivate::~PosixSignalWatcherPrivate() = default;
|
||||||
|
|
||||||
PosixSignalWatcherPrivate::PosixSignalWatcherPrivate( PosixSignalWatcher* q ) :
|
PosixSignalWatcherPrivate::PosixSignalWatcherPrivate( PosixSignalWatcher* q ) :
|
||||||
q_ptr( q )
|
q_ptr( q )
|
||||||
{
|
{
|
||||||
#if MYX_QT_HAS_POSIX_SIGNALS
|
#if MYX_QT_HAS_POSIX_SIGNALS
|
||||||
// Create socket pair
|
// Create socket pair
|
||||||
if ( ::socketpair( AF_UNIX, SOCK_STREAM, 0, mSockpair.data() ) != 0 )
|
if ( ::socketpair( AF_UNIX, SOCK_STREAM, 0, mSockpair.data() ) != 0 )
|
||||||
{
|
{
|
||||||
qDebug() << "PosixSignalWatcher: socketpair: " << ::strerror( errno );
|
qDebug() << "PosixSignalWatcher: socketpair: " << ::strerror( errno );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Create a notifier for the read end of the pair
|
// Create a notifier for the read end of the pair
|
||||||
// m_notifier.reset( new QSocketNotifier( mSockpair[1], QSocketNotifier::Read ) );
|
// m_notifier.reset( new QSocketNotifier( mSockpair[1], QSocketNotifier::Read ) );
|
||||||
@ -37,7 +37,7 @@ PosixSignalWatcherPrivate::PosixSignalWatcherPrivate( PosixSignalWatcher* q ) :
|
|||||||
Q_Q( PosixSignalWatcher );
|
Q_Q( PosixSignalWatcher );
|
||||||
|
|
||||||
int signal = 0;
|
int signal = 0;
|
||||||
(void)::read( sockfd, &signal, sizeof( signal ) );
|
(void)!::read( sockfd, &signal, sizeof( signal ) );
|
||||||
qDebug() << "Caught signal: " << ::strsignal( signal );
|
qDebug() << "Caught signal: " << ::strsignal( signal );
|
||||||
Q_EMIT q->posixSignal( signal );
|
Q_EMIT q->posixSignal( signal );
|
||||||
} );
|
} );
|
||||||
@ -61,7 +61,7 @@ MYXLIB_INLINE void PosixSignalWatcherPrivate::watchForSignal( int signal )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MYX_QT_HAS_POSIX_SIGNALS
|
#if MYX_QT_HAS_POSIX_SIGNALS
|
||||||
// Register a sigaction which will write to the socket pair
|
// Register a sigaction which will write to the socket pair
|
||||||
struct sigaction sigact;
|
struct sigaction sigact;
|
||||||
sigact.sa_handler = PosixSignalWatcherPrivate::signalHandler; //NOLINT
|
sigact.sa_handler = PosixSignalWatcherPrivate::signalHandler; //NOLINT
|
||||||
@ -73,7 +73,7 @@ MYXLIB_INLINE void PosixSignalWatcherPrivate::watchForSignal( int signal )
|
|||||||
qDebug() << "PosixSignalWatcher: sigaction: " << ::strerror( errno );
|
qDebug() << "PosixSignalWatcher: sigaction: " << ::strerror( errno );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_watchedSignals.append( signal );
|
m_watchedSignals.append( signal );
|
||||||
} // PosixSignalWatcherPrivate::watchForSignal
|
} // PosixSignalWatcherPrivate::watchForSignal
|
||||||
@ -85,7 +85,7 @@ MYXLIB_INLINE void PosixSignalWatcherPrivate::watchForSignal( int signal )
|
|||||||
*/
|
*/
|
||||||
MYXLIB_INLINE void PosixSignalWatcherPrivate::signalHandler( int signal )
|
MYXLIB_INLINE void PosixSignalWatcherPrivate::signalHandler( int signal )
|
||||||
{
|
{
|
||||||
(void)::write( mSockpair[0], &signal, sizeof( signal ) );
|
(void)!::write( mSockpair[0], &signal, sizeof( signal ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -93,8 +93,8 @@ MYXLIB_INLINE void PosixSignalWatcherPrivate::signalHandler( int signal )
|
|||||||
* Create a new PosixSignalWatcher as a child of the given \a parent.
|
* Create a new PosixSignalWatcher as a child of the given \a parent.
|
||||||
*/
|
*/
|
||||||
MYXLIB_INLINE PosixSignalWatcher::PosixSignalWatcher( QObject* parent ) :
|
MYXLIB_INLINE PosixSignalWatcher::PosixSignalWatcher( QObject* parent ) :
|
||||||
QObject( parent ),
|
QObject( parent ),
|
||||||
d_ptr ( new PosixSignalWatcherPrivate( this ) )
|
d_ptr ( new PosixSignalWatcherPrivate( this ) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user