Fix small typo
This commit is contained in:
		
							parent
							
								
									bf83a6e3a6
								
							
						
					
					
						commit
						27404a4aa7
					
				
					 4 changed files with 18 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -25,7 +25,7 @@ struct Config
 | 
			
		|||
    bool ignoreClientMachine = false;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const char *argp_program_version = "1.0";
 | 
			
		||||
const char *argp_program_version = "1.0.1";
 | 
			
		||||
const char *argp_program_bug_address = "<carl@uvos.xyz>";
 | 
			
		||||
static char doc[] = "Deamon that stops programms via SIGSTOP when their X11 windows lose focus.";
 | 
			
		||||
static char args_doc[] = "";
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ error_t parse_opt (int key, char *arg, struct argp_state *state)
 | 
			
		|||
    Config* config = reinterpret_cast<Config*>(state->input);
 | 
			
		||||
    switch (key)
 | 
			
		||||
    {
 | 
			
		||||
        case 'v':
 | 
			
		||||
        case 'i':
 | 
			
		||||
        config->ignoreClientMachine = true;
 | 
			
		||||
        break;
 | 
			
		||||
        default:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								debian/control
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/control
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -6,7 +6,7 @@ Build-Depends:
 | 
			
		|||
 debhelper,
 | 
			
		||||
 cmake,
 | 
			
		||||
 libx11-dev,
 | 
			
		||||
Standards-Version: 1.0
 | 
			
		||||
Standards-Version: 1.0.1
 | 
			
		||||
 | 
			
		||||
Package: sigstoped
 | 
			
		||||
Architecture: any
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								main.cpp
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								main.cpp
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -141,7 +141,7 @@ int main(int argc, char* argv[])
 | 
			
		|||
    Config config;
 | 
			
		||||
    argp_parse(&argp, argc, argv, 0, 0, &config);
 | 
			
		||||
    
 | 
			
		||||
    if(config->ignoreClientMachine)
 | 
			
		||||
    if(config.ignoreClientMachine)
 | 
			
		||||
    {
 | 
			
		||||
        std::cout<<"WARNING: Ignoring WM_CLIENT_MACHINE is dangerous and may cause sigstoped to stop random pids if remote windows are present"<<std::endl;
 | 
			
		||||
        XInstance::ignoreClientMachine = true;
 | 
			
		||||
| 
						 | 
				
			
			@ -150,7 +150,7 @@ int main(int argc, char* argv[])
 | 
			
		|||
    std::string confDir = getConfdir();
 | 
			
		||||
    if(confDir.size() == 0) return 1;
 | 
			
		||||
    
 | 
			
		||||
    createPidFile(confDir+"pidfile");
 | 
			
		||||
    if(!createPidFile(confDir+"pidfile")) return 1;
 | 
			
		||||
    
 | 
			
		||||
    std::vector<std::string> applicationNames = getApplicationlist(confDir+"blacklist");
 | 
			
		||||
    
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,8 +68,10 @@ bool Process::getStoped()
 | 
			
		|||
std::vector<std::string> Process::openStatus()
 | 
			
		||||
{
 | 
			
		||||
    std::fstream statusFile;
 | 
			
		||||
    statusFile.open(std::string("/proc/") + std::to_string(pid_)+ "/status", std::fstream::in);
 | 
			
		||||
    std::vector<std::string> lines;
 | 
			
		||||
    if(pid_ > 0)
 | 
			
		||||
    {
 | 
			
		||||
        statusFile.open(std::string("/proc/") + std::to_string(pid_)+ "/status", std::fstream::in);
 | 
			
		||||
        if(statusFile.is_open())
 | 
			
		||||
        {
 | 
			
		||||
            std::string statusString((std::istreambuf_iterator<char>(statusFile)),
 | 
			
		||||
| 
						 | 
				
			
			@ -81,6 +83,7 @@ std::vector<std::string> Process::openStatus()
 | 
			
		|||
        {
 | 
			
		||||
            std::cout<<"cant open "<<"/proc/" + std::to_string(pid_)+ "/status"<<std::endl;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return lines;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue