[629] in Zephyr_Bugs

home help back first fref pref prev next nref lref last post

wg_exit functionality

daemon@ATHENA.MIT.EDU (Derrick J Brashear)
Wed Jul 12 19:29:04 1995

Date: Wed, 12 Jul 1995 19:28:59 -0400 (EDT)
From: Derrick J Brashear <shadow@DEMENTIA.ORG>
To: bug-zephyr@MIT.EDU

Hi,

The following patch implements the wg_exit functionality. It adds a 
wg_exit command to zctl, and something to deal with the USER_EXIT opcode 
to zwgc (it just calls signal_exit). It also adds the opcode to zephyr.h

Let me know if you think it's useful. It was a change made in the CMU 
source base before I started here, which there doesn't seem to be an 
equivalent of in the Zephyr 2.0 sources....

Derrick

*** clients/zwgc/main.c.orig	Wed Jul 12 18:18:15 1995
--- clients/zwgc/main.c	Wed Jul 12 18:21:29 1995
***************
*** 320,325 ****
--- 320,327 ----
  	    free(class);
  	    free(instance);
  	    free(recipient);
+ 	} else if (!strcasecmp(control_opcode, USER_EXIT)) {
+           (void)signal_exit();
  	} else
  	  printf("zwgc: unknown control opcode %s.\n", control_opcode);
  
*** h/zephyr/zephyr.h.in.orig	Wed Jul 12 15:54:09 1995
--- h/zephyr/zephyr.h.in	Wed Jul 12 18:17:33 1995
***************
*** 335,339 ****
--- 341,346 ----
  #define USER_REREAD		"REREAD"	/* Opcode: Reread desc file */
  #define USER_SHUTDOWN		"SHUTDOWN"	/* Opcode: Go catatonic */
  #define USER_STARTUP		"STARTUP"	/* Opcode: Come out of it */
+ #define USER_EXIT               "EXIT"          /* Opcode: Exit the client */
  
  #endif /* __ZEPHYR_H__ */
*** clients/zctl/zctl.c.orig	Wed Jul 12 18:11:41 1995
--- clients/zctl/zctl.c	Wed Jul 12 18:15:11 1995
***************
*** 200,205 ****
--- 200,207 ----
  		notice.z_opcode = USER_SHUTDOWN;
  	if (!strcmp(argv[0],"wg_startup"))
  		notice.z_opcode = USER_STARTUP;
+         if (!strcmp(argv[0],"wg_exit"))
+                 notice.z_opcode = USER_EXIT;
  	if (!notice.z_opcode) {
  		fprintf(stderr,
  			"unknown WindowGram client control command %s\n",
*** clients/zctl/zctl_cmds.ct.orig	Wed Jul 12 18:08:30 1995
--- clients/zctl/zctl_cmds.ct	Wed Jul 12 18:11:32 1995
***************
*** 63,68 ****
--- 63,71 ----
  	request		wgc_control, "Tell the WindowGram to react to incoming notices.",
  			wg_startup;
  
+ 	request		wgc_control, "Tell the WindowGram to exit completely.",
+ 			wg_exit;
+ 
  	request		hm_control, "Tell the server to flush information about this host.",
  			hm_flush;



home help back first fref pref prev next nref lref last post