Generally improved launching of programs.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4076 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-04-14 10:34:56 +00:00
parent a7f9d28f0d
commit 05f1223db3
6 changed files with 156 additions and 47 deletions

View file

@ -34,6 +34,9 @@
#include <Foundation/NSMapTable.h>
#include <Foundation/NSSet.h>
#include <Foundation/NSHost.h>
#include <Foundation/NSTask.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSThread.h>
#include <Foundation/NSPortNameServer.h>
#include <base/TcpPort.h>
@ -47,7 +50,7 @@
* message about it - they include installation path information.
*/
#define stringify_it(X) #X
#define make_gdomap_cmd(X) stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdomap &"
#define make_gdomap_cmd(X) stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdomap"
#define make_gdomap_err(X) "check that " stringify_it(X) "/Tools/"GNUSTEP_TARGET_DIR"/gdomap is running and owned by root."
#define make_gdomap_port(X) stringify_it(X)
@ -920,9 +923,13 @@ static NSPortNameServer *defaultServer = nil;
- (void) _retry
{
static NSString *cmd = nil;
if (cmd == nil)
cmd = [NSString stringWithCString: make_gdomap_cmd(GNUSTEP_INSTALL_PREFIX)];
NSLog(@"NSPortNameServer attempting to start gdomap on local host");
system(make_gdomap_cmd(GNUSTEP_INSTALL_PREFIX));
sleep(5);
[NSTask launchedTaskWithLaunchPath: cmd arguments: nil];
[NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 5.0]];
NSLog(@"NSPortNameServer retrying connection attempt to gdomap");
[self _open: nil];
}