From 0fa3c15114be3b6bfbd32b53e9621431dbe13632 Mon Sep 17 00:00:00 2001
From: axel <axel@liljencrantz.se>
Date: Sun, 5 Feb 2006 23:12:53 +1000
Subject: [PATCH] Tweaks to some source comments

darcs-hash:20060205131253-ac50b-c3ad91b280a73fc8ec318ca6c285de773ffecfc6.gz
---
 exec.c   |  3 ++-
 reader.c | 11 +++++++++--
 signal.c |  7 +++----
 util.h   |  2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/exec.c b/exec.c
index bc9bdc50e..a77baded2 100644
--- a/exec.c
+++ b/exec.c
@@ -672,7 +672,8 @@ void exec( job_t *j )
 		signal_block();
 
 		/*
-		  setup_child_process make sure signals are propelry set up
+		  setup_child_process make sure signals are properly set
+		  up. It will also call signal_unblock
 		*/
 		if( !setup_child_process( j, 0 ) )
 		{
diff --git a/reader.c b/reader.c
index c62fb4e6a..02169f237 100644
--- a/reader.c
+++ b/reader.c
@@ -1612,6 +1612,11 @@ static void reader_interactive_init()
 	kill_init();
 	shell_pgid = getpgrp ();
 
+	/*
+	  This should enable job control on fish, even if our parent did
+	  not enable it for us.
+	*/
+
 	/* Loop until we are in the foreground.  */
 	while (tcgetpgrp( 0 ) != shell_pgid)
 	{
@@ -1644,7 +1649,6 @@ static void reader_interactive_init()
 	al_init( &prompt_list );
 	history_init();
 
-
 	common_handle_winch(0);
 
 	tcgetattr(0,&shell_modes);        /* get the current terminal modes */
@@ -1663,7 +1667,10 @@ static void reader_interactive_init()
         exit(1);
     }
 
-	/* We need to know the parents pid so we'll know if we are a subshell */
+	/* 
+	   We need to know our own pid so we'll later know if we are a
+	   fork 
+	*/
 	original_pid = getpid();
 
 	if( atexit( &exit_func ) )
diff --git a/signal.c b/signal.c
index 1afd67de7..d6f3be8cb 100644
--- a/signal.c
+++ b/signal.c
@@ -41,7 +41,6 @@ struct lookup_entry
 	   Signal description
 	*/
 	const wchar_t *desc;	
-	
 };
 
 /**
@@ -406,7 +405,7 @@ void signal_reset_handlers()
 	sigemptyset( & act.sa_mask );
 	act.sa_flags=0;
 	act.sa_handler=SIG_DFL;
-
+	
 	for( i=0; lookup[i].desc ; i++ )
 	{
 		sigaction( lookup[i].signal, &act, 0);
@@ -434,7 +433,7 @@ void signal_set_handlers()
 	sigaction( SIGTTIN, &act, 0);
 	sigaction( SIGTTOU, &act, 0);
 	sigaction( SIGCHLD, &act, 0);
-
+	
 	/*
 	  Ignore sigpipe, it is generated if fishd dies, but we can
 	  recover.
@@ -449,7 +448,7 @@ void signal_set_handlers()
 		*/
 
 		act.sa_handler=SIG_IGN;
-
+		
 		sigaction( SIGINT, &act, 0);
 		sigaction( SIGQUIT, &act, 0);
 		sigaction( SIGTSTP, &act, 0);
diff --git a/util.h b/util.h
index b63bfd848..984b131bb 100644
--- a/util.h
+++ b/util.h
@@ -232,7 +232,7 @@ const void *hash_get_key( hash_table_t *h,
 */
 int hash_get_count( hash_table_t *h);
 /**
-   Remove the specified key from the hash table
+   Remove the specified key from the hash table if it exists. Do nothing if it does not exist.
 
    \param h The hashtable
    \param key The key