ICU-11323 remove signal handler from gendict, also fix makedata.mak "clean" phase

X-SVN-Rev: 36671
This commit is contained in:
Steven R. Loomis 2014-10-10 23:44:31 +00:00
parent 5757929922
commit a9d937e314
2 changed files with 3 additions and 40 deletions

View File

@ -720,6 +720,7 @@ CLEAN : GODATA
-@erase "*.brk"
-@erase "*.res"
-@erase "*.txt"
-@erase "*.dict"
@cd "$(ICUBLD_PKG)\$(ICUCOL)"
-@erase "*.res"
-@erase "*.txt"

View File

@ -1,6 +1,6 @@
/*
**********************************************************************
* Copyright (C) 2002-2013, International Business Machines
* Copyright (C) 2002-2014, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*
@ -43,42 +43,6 @@ static int elapsedTime() {
return (int)uprv_floor((uprv_getRawUTCtime()-startTime)/1000.0);
}
#if U_PLATFORM_IMPLEMENTS_POSIX && !U_PLATFORM_HAS_WIN32_API
#include <signal.h>
#include <unistd.h>
const char *wToolname="gendict";
const char *wOutname="(some file)";
const int firstSeconds = 5; /* seconds between notices*/
const int nextSeconds = 15; /* seconds between notices*/
static void alarm_fn(int /*n*/) {
printf("%s: still writing\t%s (%ds)\t...\n", wToolname, wOutname, elapsedTime());
signal(SIGALRM, &alarm_fn);
alarm(nextSeconds); // reset the alarm
}
static void install_watchdog(const char *toolName, const char *outFileName) {
wToolname=toolName;
wOutname=outFileName;
signal(SIGALRM, &alarm_fn);
alarm(firstSeconds); // set the alarm
}
#else
static void install_watchdog(const char*, const char*) {
// not implemented
}
#endif
U_NAMESPACE_USE
static char *progName;
@ -300,10 +264,8 @@ int main(int argc, char **argv) {
const char *wordFileName = argv[1];
startTime = uprv_getRawUTCtime(); // initialize start timer
// set up the watchdog
install_watchdog(progName, outFileName);
if (options[ARG_ICUDATADIR].doesOccur) {
if (options[ARG_ICUDATADIR].doesOccur) {
u_setDataDirectory(options[ARG_ICUDATADIR].value);
}