Fix small typo
This commit is contained in:
@ -25,7 +25,7 @@ struct Config
|
|||||||
bool ignoreClientMachine = false;
|
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>";
|
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 doc[] = "Deamon that stops programms via SIGSTOP when their X11 windows lose focus.";
|
||||||
static char args_doc[] = "";
|
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);
|
Config* config = reinterpret_cast<Config*>(state->input);
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case 'v':
|
case 'i':
|
||||||
config->ignoreClientMachine = true;
|
config->ignoreClientMachine = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
2
debian/control
vendored
2
debian/control
vendored
@ -6,7 +6,7 @@ Build-Depends:
|
|||||||
debhelper,
|
debhelper,
|
||||||
cmake,
|
cmake,
|
||||||
libx11-dev,
|
libx11-dev,
|
||||||
Standards-Version: 1.0
|
Standards-Version: 1.0.1
|
||||||
|
|
||||||
Package: sigstoped
|
Package: sigstoped
|
||||||
Architecture: any
|
Architecture: any
|
||||||
|
4
main.cpp
4
main.cpp
@ -141,7 +141,7 @@ int main(int argc, char* argv[])
|
|||||||
Config config;
|
Config config;
|
||||||
argp_parse(&argp, argc, argv, 0, 0, &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;
|
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;
|
XInstance::ignoreClientMachine = true;
|
||||||
@ -150,7 +150,7 @@ int main(int argc, char* argv[])
|
|||||||
std::string confDir = getConfdir();
|
std::string confDir = getConfdir();
|
||||||
if(confDir.size() == 0) return 1;
|
if(confDir.size() == 0) return 1;
|
||||||
|
|
||||||
createPidFile(confDir+"pidfile");
|
if(!createPidFile(confDir+"pidfile")) return 1;
|
||||||
|
|
||||||
std::vector<std::string> applicationNames = getApplicationlist(confDir+"blacklist");
|
std::vector<std::string> applicationNames = getApplicationlist(confDir+"blacklist");
|
||||||
|
|
||||||
|
@ -68,8 +68,10 @@ bool Process::getStoped()
|
|||||||
std::vector<std::string> Process::openStatus()
|
std::vector<std::string> Process::openStatus()
|
||||||
{
|
{
|
||||||
std::fstream statusFile;
|
std::fstream statusFile;
|
||||||
statusFile.open(std::string("/proc/") + std::to_string(pid_)+ "/status", std::fstream::in);
|
|
||||||
std::vector<std::string> lines;
|
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())
|
if(statusFile.is_open())
|
||||||
{
|
{
|
||||||
std::string statusString((std::istreambuf_iterator<char>(statusFile)),
|
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;
|
std::cout<<"cant open "<<"/proc/" + std::to_string(pid_)+ "/status"<<std::endl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user