X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fkillpid.h;h=6bf5dee39b92d6854cda78b9bef823158d1cb3fd;hb=2eae87612891b9cd1920c4afa8515b208e12958d;hp=d67ec94b9770b599cf3debe1a276e77abeef3126;hpb=7abcaebdc4c3dd11b779eaef58a7371fb82ae888;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); +}