mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 20:26:42 +00:00
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:
parent
a7f9d28f0d
commit
05f1223db3
6 changed files with 156 additions and 47 deletions
|
@ -28,6 +28,9 @@
|
|||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSArchiver.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
#include <Foundation/NSDate.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
#include <Foundation/NSTask.h>
|
||||
#include <Foundation/NSDistributedNotificationCenter.h>
|
||||
|
||||
#include "../Tools/gdnc.h"
|
||||
|
@ -37,8 +40,8 @@
|
|||
* message about it - they include installation path information.
|
||||
*/
|
||||
#define stringify_it(X) #X
|
||||
#define make_gdnc_cmd(X) stringify_it(X) "/Tools/" GNUSTEP_TARGET_DIR "/" LIBRARY_COMBO "/gdnc &"
|
||||
#define make_gdnc_err(X) "check that " stringify_it(X) "/Tools/" GNUSTEP_TARGET_DIR "/" LIBRARY_COMBO "/gdnc is running."
|
||||
#define make_gdnc_cmd(X) stringify_it(X) "/Tools/" GNUSTEP_TARGET_DIR "/gdnc"
|
||||
#define make_gdnc_err(X) "check that " stringify_it(X) "/Tools/" GNUSTEP_TARGET_DIR "/gdnc is running."
|
||||
|
||||
/*
|
||||
* Global variables for distributed notification center types.
|
||||
|
@ -335,10 +338,17 @@ static NSDistributedNotificationCenter *defCenter = nil;
|
|||
|
||||
if (recursion == NO)
|
||||
{
|
||||
static NSString *cmd = nil;
|
||||
|
||||
if (cmd == nil)
|
||||
cmd = [NSString stringWithCString:
|
||||
make_gdnc_cmd(GNUSTEP_INSTALL_PREFIX)];
|
||||
|
||||
NSLog(@"NSDistributedNotificationCenter failed to contact GDNC server.\n");
|
||||
NSLog(@"Attempting to start GDNC process - this will take several seconds.\n");
|
||||
system(make_gdnc_cmd(GNUSTEP_INSTALL_PREFIX));
|
||||
sleep(8);
|
||||
[NSTask launchedTaskWithLaunchPath: cmd arguments: nil];
|
||||
[NSThread sleepUntilDate:
|
||||
[NSDate dateWithTimeIntervalSinceNow: 8.0]];
|
||||
NSLog(@"Retrying connection to the GDNC server.\n");
|
||||
recursion = YES;
|
||||
[self _connect];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue