diff options
author | 2005-11-28 09:22:08 +1000 | |
---|---|---|
committer | 2005-11-28 09:22:08 +1000 | |
commit | bda7948719555dd7745a416d79aa7e21a252fbdb (patch) | |
tree | 04c80e052808cf612be9584054d395f5294c1c0c /env_universal.c | |
parent | e800fca499a537c0c57e7e504ed2a4ceff91fda4 (diff) |
Make sure fishd synchronization happens only when needed
darcs-hash:20051127232208-ac50b-927157fb9b5d3e44981f9ec029735531ae59fd61.gz
Diffstat (limited to 'env_universal.c')
-rw-r--r-- | env_universal.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/env_universal.c b/env_universal.c index 0a2aaadd..f9b14b94 100644 --- a/env_universal.c +++ b/env_universal.c @@ -117,19 +117,16 @@ static int get_socket( int fork_ok ) if( connect( s, (struct sockaddr *)&local, len) == -1 ) { close( s ); - if( fork_ok ) + if( fork_ok && start_fishd ) { debug( 2, L"Could not connect to socket %d, starting fishd", s ); - if( start_fishd ) - { - start_fishd(); - } - + start_fishd(); + return get_socket( 0 ); } - debug( 3, L"Could not connect to socket %d, already tried forking, giving up", s ); + debug( 2, L"Could not connect to socket %d, already tried manual restart (or no command supplied), giving up", s ); return -1; } @@ -305,7 +302,7 @@ void env_universal_barrier() if( !init || ( env_universal_server.fd == -1 )) return; - + barrier_reply = 0; /* @@ -330,6 +327,7 @@ void env_universal_barrier() if( env_universal_server.fd == -1 ) { reconnect(); + debug( 2, L"barrier interrupted, exiting" ); return; } @@ -347,6 +345,7 @@ void env_universal_barrier() if( env_universal_server.fd == -1 ) { reconnect(); + debug( 2, L"barrier interrupted, exiting (2)" ); return; } FD_ZERO( &fds ); @@ -365,7 +364,7 @@ void env_universal_set( const wchar_t *name, const wchar_t *value, int export ) if( !init ) return; - debug( 3, L"env_universal_set( %ls, %ls )", name, value ); + debug( 3, L"env_universal_set( \"%ls\", \"%ls\" )", name, value ); msg = create_message( export?SET_EXPORT:SET, name, @@ -388,8 +387,8 @@ void env_universal_remove( const wchar_t *name ) if( !init ) return; - debug( 2, - L"env_universal_remove( %ls )", + debug( 3, + L"env_universal_remove( \"%ls\" )", name ); msg= create_message( ERASE, name, 0); |