Loading trusty/libtrusty/trusty.c +21 −25 Original line number Diff line number Diff line Loading @@ -29,24 +29,21 @@ #include <trusty/ipc.h> int tipc_connect(const char *dev_name, const char *srv_name) { int tipc_connect(const char* dev_name, const char* srv_name) { int fd; int rc; fd = open(dev_name, O_RDWR); fd = TEMP_FAILURE_RETRY(open(dev_name, O_RDWR)); if (fd < 0) { rc = -errno; ALOGE("%s: cannot open tipc device \"%s\": %s\n", __func__, dev_name, strerror(errno)); ALOGE("%s: cannot open tipc device \"%s\": %s\n", __func__, dev_name, strerror(errno)); return rc < 0 ? rc : -1; } rc = ioctl(fd, TIPC_IOC_CONNECT, srv_name); rc = TEMP_FAILURE_RETRY(ioctl(fd, TIPC_IOC_CONNECT, srv_name)); if (rc < 0) { rc = -errno; ALOGE("%s: can't connect to tipc service \"%s\" (err=%d)\n", __func__, srv_name, errno); ALOGE("%s: can't connect to tipc service \"%s\" (err=%d)\n", __func__, srv_name, errno); close(fd); return rc < 0 ? rc : -1; } Loading @@ -63,7 +60,7 @@ ssize_t tipc_send(int fd, const struct iovec* iov, int iovcnt, struct trusty_shm req.shm = (__u64)shms; req.shm_cnt = (__u64)shmcnt; int rc = ioctl(fd, TIPC_IOC_SEND_MSG, &req); int rc = TEMP_FAILURE_RETRY(ioctl(fd, TIPC_IOC_SEND_MSG, &req)); if (rc < 0) { ALOGE("%s: failed to send message (err=%d)\n", __func__, rc); } Loading @@ -71,7 +68,6 @@ ssize_t tipc_send(int fd, const struct iovec* iov, int iovcnt, struct trusty_shm return rc; } void tipc_close(int fd) { void tipc_close(int fd) { close(fd); } Loading
trusty/libtrusty/trusty.c +21 −25 Original line number Diff line number Diff line Loading @@ -29,24 +29,21 @@ #include <trusty/ipc.h> int tipc_connect(const char *dev_name, const char *srv_name) { int tipc_connect(const char* dev_name, const char* srv_name) { int fd; int rc; fd = open(dev_name, O_RDWR); fd = TEMP_FAILURE_RETRY(open(dev_name, O_RDWR)); if (fd < 0) { rc = -errno; ALOGE("%s: cannot open tipc device \"%s\": %s\n", __func__, dev_name, strerror(errno)); ALOGE("%s: cannot open tipc device \"%s\": %s\n", __func__, dev_name, strerror(errno)); return rc < 0 ? rc : -1; } rc = ioctl(fd, TIPC_IOC_CONNECT, srv_name); rc = TEMP_FAILURE_RETRY(ioctl(fd, TIPC_IOC_CONNECT, srv_name)); if (rc < 0) { rc = -errno; ALOGE("%s: can't connect to tipc service \"%s\" (err=%d)\n", __func__, srv_name, errno); ALOGE("%s: can't connect to tipc service \"%s\" (err=%d)\n", __func__, srv_name, errno); close(fd); return rc < 0 ? rc : -1; } Loading @@ -63,7 +60,7 @@ ssize_t tipc_send(int fd, const struct iovec* iov, int iovcnt, struct trusty_shm req.shm = (__u64)shms; req.shm_cnt = (__u64)shmcnt; int rc = ioctl(fd, TIPC_IOC_SEND_MSG, &req); int rc = TEMP_FAILURE_RETRY(ioctl(fd, TIPC_IOC_SEND_MSG, &req)); if (rc < 0) { ALOGE("%s: failed to send message (err=%d)\n", __func__, rc); } Loading @@ -71,7 +68,6 @@ ssize_t tipc_send(int fd, const struct iovec* iov, int iovcnt, struct trusty_shm return rc; } void tipc_close(int fd) { void tipc_close(int fd) { close(fd); }