X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fkillpid.h;h=6bf5dee39b92d6854cda78b9bef823158d1cb3fd;hb=1adc67d1609fd71308b822e153dcb08ad7fbf9c2;hp=d67ec94b9770b599cf3debe1a276e77abeef3126;hpb=04b8554c3724eae57fbd75dc6b3e69dca8b58187;p=awesomized%2Flibmemcached diff --git a/libtest/killpid.h b/libtest/killpid.h index d67ec94b..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,4 +39,13 @@ bool kill_pid(pid_t pid_arg); -void 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); + +static inline bool check_pid(pid_t pid_arg) +{ + return (pid_arg > 1); +}