mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-19 01:51:03 +00:00
fixup error in last change, when -Wait not used
This commit is contained in:
parent
2ce9916ae8
commit
f320aece3a
1 changed files with 21 additions and 13 deletions
34
Terminate.m
34
Terminate.m
|
@ -133,33 +133,41 @@ main()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSConnection *c = [proxy connectionForProxy];
|
NSConnection *c = [proxy connectionForProxy];
|
||||||
NSTimeInterval seconds = [defs doubleForKey: @"Wait"];
|
|
||||||
unsigned active;
|
unsigned active;
|
||||||
NSDate *by;
|
NSDate *by;
|
||||||
|
|
||||||
if (isnan(seconds) || 0.0 == seconds)
|
if (nil == [defs objectForKey: @"Wait"])
|
||||||
{
|
{
|
||||||
by = nil;
|
by = nil; // No waiting, default grace period
|
||||||
}
|
}
|
||||||
else if (seconds < 0.5)
|
else
|
||||||
{
|
{
|
||||||
seconds = 0.5;
|
NSTimeInterval seconds = [defs doubleForKey: @"Wait"];
|
||||||
}
|
|
||||||
else if (seconds > 900.0)
|
if (isnan(seconds) || 0.0 == seconds)
|
||||||
{
|
{
|
||||||
seconds = 900.0;
|
by = nil;
|
||||||
}
|
}
|
||||||
by = [NSDate dateWithTimeIntervalSinceNow: seconds];
|
else if (seconds < 0.5)
|
||||||
|
{
|
||||||
|
seconds = 0.5;
|
||||||
|
}
|
||||||
|
else if (seconds > 900.0)
|
||||||
|
{
|
||||||
|
seconds = 900.0;
|
||||||
|
}
|
||||||
|
by = [NSDate dateWithTimeIntervalSinceNow: seconds];
|
||||||
|
}
|
||||||
if ([proxy respondsToSelector: @selector(activeCount)])
|
if ([proxy respondsToSelector: @selector(activeCount)])
|
||||||
{
|
{
|
||||||
active = [proxy activeCount];
|
active = [(id<Command>)proxy activeCount];
|
||||||
[(id<Command>)proxy terminate: by];
|
[(id<Command>)proxy terminate: by];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
by = nil; // Waiting not supported with this API.
|
||||||
active = 0;
|
active = 0;
|
||||||
[(id<EcCommandOld>)proxy terminate];
|
[(id<EcCommandOld>)proxy terminate];
|
||||||
by = nil; // Waiting not supported with this API.
|
|
||||||
}
|
}
|
||||||
if (nil == by)
|
if (nil == by)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue