X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fkillpid.h;h=6bf5dee39b92d6854cda78b9bef823158d1cb3fd;hb=a7df49566dd006c5725eabcd11aab958cf8e5600;hp=12c438e5f391a9c85ef47f2045304154ecb64b3f;hpb=582b47ae25f9fecc459204592f23491297488cd8;p=m6w6%2Flibmemcached diff --git a/libtest/killpid.h b/libtest/killpid.h index 12c438e5..6bf5dee3 100644 --- a/libtest/killpid.h +++ b/libtest/killpid.h @@ -1,8 +1,8 @@ /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * uTest * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * Data Differential YATL (i.e. libtest) library + * + * Copyright (C) 2012 Data Differential, http://datadifferential.com/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -39,6 +39,13 @@ bool kill_pid(pid_t pid_arg); -pid_t kill_file(const std::string &filename); +bool kill_file(const std::string &filename); + +bool check_pid(const std::string &filename); + +pid_t get_pid_from_file(const std::string &filename, std::stringstream& error_message); -pid_t get_pid_from_file(const std::string &filename); +static inline bool check_pid(pid_t pid_arg) +{ + return (pid_arg > 1); +}