From 6a1adb490b095a403b4cc10ccc61821e2fe04107 Mon Sep 17 00:00:00 2001 From: "Michael J. Pounders" Date: Tue, 25 Nov 2014 19:33:48 -0500 Subject: [PATCH] Fix a few bugs --- shm_utils/mon-umurmurd/CHANGES | 9 +++++++-- shm_utils/mon-umurmurd/Makefile | 2 +- shm_utils/mon-umurmurd/mon-umurmurd.c | 4 ++-- src/sharedmemory.c | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/shm_utils/mon-umurmurd/CHANGES b/shm_utils/mon-umurmurd/CHANGES index 93ead4a..9b4f768 100644 --- a/shm_utils/mon-umurmurd/CHANGES +++ b/shm_utils/mon-umurmurd/CHANGES @@ -1,3 +1,9 @@ +* BUG_FIX: Fix the screen not clearing when last person exits the server + + +* Code clean up + + * Added more client data 99% of the useful client data shown * rework Sharedmemory_update() to not use memcpy (requested by fatbob) @@ -5,10 +11,9 @@ * Using a more modern unix sharedmemory API. this requires linking with librt.so (requested by fatbob) * Added away to know if umurmurd is not connected/updateing the shm_t struct. I use 8bit timer with rollover protection see check_serverTick() and where I use the function near bottum of mon-umurmurd.c - for how to use this. + for how to use this. * code clean up and some comments added * ~95% of the useful client data shown * outputs a more meaningful idle and online time, both are reported in secs (error reported by fatbob) - \ No newline at end of file diff --git a/shm_utils/mon-umurmurd/Makefile b/shm_utils/mon-umurmurd/Makefile index 9ecd325..e10e898 100644 --- a/shm_utils/mon-umurmurd/Makefile +++ b/shm_utils/mon-umurmurd/Makefile @@ -20,6 +20,6 @@ clean: rm -rf $(PROGRAMS) install: all - + cp mon-umurmurd /usr/local/bin/ .PHONY: install diff --git a/shm_utils/mon-umurmurd/mon-umurmurd.c b/shm_utils/mon-umurmurd/mon-umurmurd.c index 2944599..18a8a97 100644 --- a/shm_utils/mon-umurmurd/mon-umurmurd.c +++ b/shm_utils/mon-umurmurd/mon-umurmurd.c @@ -93,7 +93,7 @@ void run_shm(void) int cc; - printf( "\033[2J\033[H" ); //clear screen VT100 + printf( "\033[2J\033[H" ); fflush(stdout); //clear screen VT100 for( cc = 0 ; cc < shmptr->server_max_clients ; cc++ ) @@ -150,4 +150,4 @@ int cc; { exit(EXIT_FAILURE); //You dont have to exit you could just report the fact that the data is not valid } -} \ No newline at end of file +} diff --git a/src/sharedmemory.c b/src/sharedmemory.c index 0421fe0..f8c420c 100644 --- a/src/sharedmemory.c +++ b/src/sharedmemory.c @@ -105,6 +105,6 @@ void Sharedmemory_alivetick(void) void Sharedmemory_deinit(void) { close( shm_fd ); - unlink( shm_file_name ); + shm_unlink( shm_file_name ); shmptr->umurmurd_pid = 0; -} \ No newline at end of file +} -- 2.30.2