1/* 2 * Copyright © 2020 Collabora, Ltd. 3 * Author: Antonio Caggiano <antonio.caggiano@collabora.com> 4 * 5 * SPDX-License-Identifier: MIT 6 */ 7 8#include "pps.h" 9 10#include <cerrno> 11#include <cstring> 12 13namespace pps 14{ 15bool check(int res, const char *msg) 16{ 17 if (res < 0) { 18 char *err_msg = std::strerror(errno); 19 PERFETTO_ELOG("%s: %s", msg, err_msg); 20 return false; 21 } 22 23 return true; 24} 25 26} // namespace pps 27