diff --git a/reactos/tools/sysreg/os_support.cpp b/reactos/tools/sysreg/os_support.cpp index 39125438e2c..a62593d780b 100644 --- a/reactos/tools/sysreg/os_support.cpp +++ b/reactos/tools/sysreg/os_support.cpp @@ -15,7 +15,7 @@ namespace System_ OsSupport::TimeEntryVector OsSupport::s_Entries; //int gettimeofday(struct timeval *tv, void * tz); - +//------------------------------------------------------------------------ void OsSupport::checkAlarms() { struct timeval tm; @@ -44,7 +44,11 @@ namespace System_ } #endif } - + bool OsSupport::hasAlarms () + { + return (s_Entries.size () != 0); + } +//------------------------------------------------------------------------ void OsSupport::cancelAlarms() { @@ -284,6 +288,18 @@ __inline int gettimeofday(struct timeval *tv, struct timezone *tz) { OsSupport::checkAlarms(); } + else if (sig == SIGCHLD) + { + if (OsSupport::hasAlarms()) + { + /// + /// FIXME + /// + /// there are expiriation alarms active and a child died unexpectly + /// lets commit suicide + exit(-2); + } + } } void OsSupport::setAlarm(long secs, OsSupport::ProcessID pid) { diff --git a/reactos/tools/sysreg/os_support.h b/reactos/tools/sysreg/os_support.h index a4a54b95efb..ed8499d0fe7 100644 --- a/reactos/tools/sysreg/os_support.h +++ b/reactos/tools/sysreg/os_support.h @@ -120,6 +120,13 @@ namespace System_ static void checkAlarms(); +///--------------------------------------------------------------------------------------- +/// +/// hasAlarms +/// +/// Description: this function checks wether there are alarms set active + + static bool hasAlarms(); protected: //---------------------------------------------------------------------------------------