aboutsummaryrefslogtreecommitdiff
path: root/src/sman
diff options
context:
space:
mode:
Diffstat (limited to 'src/sman')
-rw-r--r--src/sman/ChangeLog5
-rw-r--r--src/sman/sman.c.pamphlet20
2 files changed, 20 insertions, 5 deletions
diff --git a/src/sman/ChangeLog b/src/sman/ChangeLog
index f433a88c..a5722d5f 100644
--- a/src/sman/ChangeLog
+++ b/src/sman/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-13 Alfredo Portes <alfredo.portes@gmail.com>
+ Waldek Hebisch <hebisch@math.uni.wroc.pl>
+
+ * sman.c.pamphlet: Add cleanup function for HyperDoc sockets.
+
2007-08-10 Gabriel Dos Reis <gdr@cs.tamu.edu>
* sman.c.pamphlet (HypertexProgram): hypertex is installed in lib/
diff --git a/src/sman/sman.c.pamphlet b/src/sman/sman.c.pamphlet
index d0419627..84243dd9 100644
--- a/src/sman/sman.c.pamphlet
+++ b/src/sman/sman.c.pamphlet
@@ -24,6 +24,8 @@
#define NadaDelShitsky 2
/* When a process dies start it up again */
#define DoItAgain 3
+/* When hypertex dies, clean its socket */
+#define CleanHypertexSocket 4
typedef struct spad_proc {
int proc_id; /* process id of child */
@@ -641,7 +643,7 @@ start_the_hypertex(void)
sprintf(prog, "%s -k -rv %s", HypertexProgram, VerifyRecordFile);
spawn_of_hell(prog, NadaDelShitsky);
}
- else spawn_of_hell(HypertexProgram, NadaDelShitsky);
+ else spawn_of_hell(HypertexProgram, CleanHypertexSocket);
}
@
@@ -753,6 +755,14 @@ start_the_Axiom(char **envp)
\subsection{clean\_up\_sockets}
<<cleanupsockets>>=
static void
+clean_hypertex_socket(void)
+{
+ char name[256];
+ sprintf(name, "%s%d", MenuServerName, server_num);
+ unlink(name);
+}
+
+static void
clean_up_sockets(void)
{
char name[256];
@@ -762,8 +772,7 @@ clean_up_sockets(void)
unlink(name);
sprintf(name, "%s%d", SessionIOName, server_num);
unlink(name);
- sprintf(name, "%s%d", MenuServerName, server_num);
- unlink(name);
+ clean_hypertex_socket();
}
@
@@ -940,7 +949,6 @@ monitor_children(void)
if (dead_baby == -1 && death_signal) {
kill_all_children();
clean_up_sockets();
- clean_up_terminal();
sleep(2);
exit(0);
}
@@ -967,7 +975,6 @@ monitor_children(void)
case Die:
kill_all_children();
clean_up_sockets();
- clean_up_terminal();
sleep(2);
exit(0);
case NadaDelShitsky:
@@ -975,6 +982,9 @@ monitor_children(void)
case DoItAgain:
spawn_of_hell(proc->command, DoItAgain);
break;
+ case CleanHypertexSocket:
+ clean_hypertex_socket();
+ break;
}
}
}