diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hyper/ChangeLog | 5 | ||||
-rw-r--r-- | src/hyper/hyper.pamphlet | 5 | ||||
-rw-r--r-- | src/include/sman.H1 | 1 | ||||
-rw-r--r-- | src/sman/ChangeLog | 5 | ||||
-rw-r--r-- | src/sman/sman.c.pamphlet | 20 |
5 files changed, 29 insertions, 7 deletions
diff --git a/src/hyper/ChangeLog b/src/hyper/ChangeLog index 316d8b7b..4219fb2a 100644 --- a/src/hyper/ChangeLog +++ b/src/hyper/ChangeLog @@ -1,3 +1,8 @@ +2007-09-13 Alfredo Portes <alfredo.portes@gmail.com> + Waldek Hebisch <hebisch@math.uni.wroc.pl> + + * hyper.pamphlet : Cleanup HyperDoc sockets when restart. + 2007-07-29 Gabriel Dos Reis <gdr@cs.tamu.edu> * Makefile.pamphlet: Propagate libtoolization changes. diff --git a/src/hyper/hyper.pamphlet b/src/hyper/hyper.pamphlet index 3e407d07..8f514af8 100644 --- a/src/hyper/hyper.pamphlet +++ b/src/hyper/hyper.pamphlet @@ -949,9 +949,10 @@ make_server_connections(void) if (open_server(MenuServerName) == -2) { fprintf(stderr, "(HyperDoc) Warning: Not connected to AXIOM Server!\n"); MenuServerOpened = 0; - } - else + } else { + atexit(&clean_socket); MenuServerOpened = 1; + } /* diff --git a/src/include/sman.H1 b/src/include/sman.H1 index 20dbc909..96452899 100644 --- a/src/include/sman.H1 +++ b/src/include/sman.H1 @@ -25,6 +25,7 @@ static void start_the_graphics(void); static void fork_Axiom(void); static void start_the_Axiom(char * * envp); static void clean_up_sockets(void); +static void clean_hypertex_socket(void); static void read_from_spad_io(int ptcNum); static void read_from_manager(int ptcNum); static void manage_spad_io(int ptcNum); 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; } } } |