Now using correct default server.
This commit is contained in:
		
							
								
								
									
										23
									
								
								lib/init.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								lib/init.c
									
									
									
									
									
								
							@@ -173,9 +173,32 @@ glibtop_init_r (glibtop **server_ptr, const unsigned long features,
 | 
			
		||||
	/* Do the initialization, but only if not already initialized. */
 | 
			
		||||
 | 
			
		||||
	if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) {
 | 
			
		||||
		if (flags & GLIBTOP_FEATURES_EXCEPT)
 | 
			
		||||
			features = ~features & GLIBTOP_SYSDEPS_ALL;
 | 
			
		||||
		
 | 
			
		||||
		if (features == 0)
 | 
			
		||||
			features = GLIBTOP_SYSDEPS_ALL;
 | 
			
		||||
		
 | 
			
		||||
		if (flags & GLIBTOP_FEATURES_NO_SERVER) {
 | 
			
		||||
			server->method = GLIBTOP_METHOD_DIRECT;
 | 
			
		||||
			features = 0;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		server->features = features;
 | 
			
		||||
		
 | 
			
		||||
		_init_server (server, features);
 | 
			
		||||
		
 | 
			
		||||
		server->flags |= _GLIBTOP_INIT_STATE_INIT;
 | 
			
		||||
		
 | 
			
		||||
		switch (server->method) {
 | 
			
		||||
		case GLIBTOP_METHOD_PIPE:
 | 
			
		||||
		case GLIBTOP_METHOD_UNIX:
 | 
			
		||||
			if (glibtop_server_features & features)
 | 
			
		||||
				break;
 | 
			
		||||
			
 | 
			
		||||
			server->method = GLIBTOP_METHOD_DIRECT;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Should we open the server? */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								lib/open.c
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								lib/open.c
									
									
									
									
									
								
							@@ -43,19 +43,6 @@ glibtop_open_l (glibtop *server, const char *program_name,
 | 
			
		||||
 | 
			
		||||
	server->flags |= _GLIBTOP_INIT_STATE_OPEN;
 | 
			
		||||
 | 
			
		||||
	if (flags & GLIBTOP_FEATURES_EXCEPT)
 | 
			
		||||
		features = ~features & GLIBTOP_SYSDEPS_ALL;
 | 
			
		||||
 | 
			
		||||
	if (features == 0)
 | 
			
		||||
		features = GLIBTOP_SYSDEPS_ALL;
 | 
			
		||||
 | 
			
		||||
	if (flags & GLIBTOP_FEATURES_NO_SERVER) {
 | 
			
		||||
		server->method = GLIBTOP_METHOD_DIRECT;
 | 
			
		||||
		features = 0;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	server->features = features;
 | 
			
		||||
 | 
			
		||||
	server->error_method = GLIBTOP_ERROR_METHOD_DEFAULT;
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
@@ -65,18 +52,6 @@ glibtop_open_l (glibtop *server, const char *program_name,
 | 
			
		||||
		 sizeof (glibtop_sysdeps), sizeof (glibtop_response_union));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	switch (server->method) {
 | 
			
		||||
	case GLIBTOP_METHOD_PIPE:
 | 
			
		||||
	case GLIBTOP_METHOD_UNIX:
 | 
			
		||||
		if (glibtop_server_features & features)
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
		fprintf (stderr, "Using the server is not required.\n");
 | 
			
		||||
 | 
			
		||||
		server->method = GLIBTOP_METHOD_DIRECT;
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch (server->method) {
 | 
			
		||||
	case GLIBTOP_METHOD_DIRECT:
 | 
			
		||||
		server->features = 0;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user