allow SIGAR_PATH env var to set self_path
This commit is contained in:
		
							parent
							
								
									5fc7cc7134
								
							
						
					
					
						commit
						6f67476977
					
				@ -540,6 +540,13 @@ char *sigar_get_self_path(sigar_t *sigar)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    if (!sigar->self_path) {
 | 
					    if (!sigar->self_path) {
 | 
				
			||||||
        sigar_proc_modules_t procmods;
 | 
					        sigar_proc_modules_t procmods;
 | 
				
			||||||
 | 
					        char *self_path = getenv("SIGAR_PATH");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (self_path) {
 | 
				
			||||||
 | 
					            sigar->self_path = sigar_strdup(self_path);
 | 
				
			||||||
 | 
					            return sigar->self_path;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        procmods.module_getter = proc_module_get_self;
 | 
					        procmods.module_getter = proc_module_get_self;
 | 
				
			||||||
        procmods.data = sigar;
 | 
					        procmods.data = sigar;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user