diff options
author | alfredoport <doyenatccny@gmail.com> | 2007-09-13 22:11:13 +0000 |
---|---|---|
committer | alfredoport <doyenatccny@gmail.com> | 2007-09-13 22:11:13 +0000 |
commit | 09784132ff79b5f253ab2825d965c4b529e27246 (patch) | |
tree | 082e2b01df9d1a401183eaf056236f26d351f22c /src/sman/sman.c.pamphlet | |
parent | 3a1b2980a28cd0a1f2e730df1512ff11c62b6151 (diff) | |
download | open-axiom-09784132ff79b5f253ab2825d965c4b529e27246.tar.gz |
Fix bug when restarting HyperDoc
Diffstat (limited to 'src/sman/sman.c.pamphlet')
-rw-r--r-- | src/sman/sman.c.pamphlet | 20 |
1 files changed, 15 insertions, 5 deletions
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; } } } |