OPERATION_TYPE_WRITE
};
- AbstractDBHandler(uid_t uid, int pid);
+ AbstractDBHandler(uid_t uid, pid_t pid);
virtual ~AbstractDBHandler();
virtual int Execute() = 0;
void SetLocale(const std::string& locale);
DBType db_type_ = DB_TYPE_NONE;
OperationType op_type_ = OPERATION_TYPE_NONE;
uid_t uid_;
- int pid_;
+ pid_t pid_;
std::string locale_;
std::vector<sqlite3*> db_handle_list_;
};
* limitations under the License.
*/
+#include <sys/types.h>
+
#include <tzplatform_config.h>
#include "db_handle_provider.hh"
return *prov;
}
-std::vector<std::string> DBHandleProvider::GetParserDBPath(int pid) {
+std::vector<std::string> DBHandleProvider::GetParserDBPath(pid_t pid) {
std::unique_lock<std::mutex> u(lock_);
std::vector<std::string> db_path_list;
bool is_file_access = is_memory_;
- std::vector<int>::iterator it = std::find(pid_list_.begin(),
+ std::vector<pid_t>::iterator it = std::find(pid_list_.begin(),
pid_list_.end(), pid);
if (it == pid_list_.end())
is_file_access = true;
return db_path_list;
}
-std::string DBHandleProvider::GetCertDBPath(int pid) {
+std::string DBHandleProvider::GetCertDBPath(pid_t pid) {
std::unique_lock<std::mutex> u(lock_);
bool is_file_access = is_memory_;
- std::vector<int>::iterator it = std::find(pid_list_.begin(),
+ std::vector<pid_t>::iterator it = std::find(pid_list_.begin(),
pid_list_.end(), pid);
if (it == pid_list_.end())
is_file_access = true;
return memorydb;
}
-void DBHandleProvider::SetMemoryMode(int pid, bool flag) {
+void DBHandleProvider::SetMemoryMode(pid_t pid, bool flag) {
std::unique_lock<std::mutex> u(lock_);
if (is_memory_ == flag)
return;
parser_memory_db_handle_.reset(nullptr);
cert_memory_db_handle_.reset(nullptr);
global_parser_memory_db_handle_.reset(nullptr);
- std::vector<int>::iterator it =
+ std::vector<pid_t>::iterator it =
std::find(pid_list_.begin(), pid_list_.end(), pid);
if (it != pid_list_.end())
pid_list_.erase(it);
#define SERVER_ABSTRACT_REQUEST_HANDLER_HH_
#include <string>
+
+#include <sys/types.h>
+
#include <parcel.hh>
namespace pkgmgr_server {
virtual bool HandleRequest(unsigned char* data, int size, std::string locale) = 0;
virtual std::vector<uint8_t> GetResult() = 0;
- void SetPID(int pid);
+ void SetPID(pid_t pid);
protected:
- int GetPID();
+ pid_t GetPID();
private:
- int pid_;
+ pid_t pid_;
};
} // namespace request_handler
#define SERVER_PKG_REQUEST_HH_
#include <memory>
+
+#include <sys/types.h>
+
#include "data_socket.hh"
#include "request_type.hh"
~PkgRequest();
unsigned char* GetData();
int GetSize();
- int GetSenderPID();
+ pid_t GetSenderPID();
pkgmgr_common::ReqType GetRequestType();
bool ReceiveData();
bool SendData(unsigned char* data, int size);