} mt_rfid_t;
// connect to the reader, add self to loop and make it write to fd
+// return 0 on success, negative number otherwise
int mt_rfid_init(mt_rfid_t *self, struct ev_loop *loop, int fd);
// disconnect from reader
set_signal_exit(loop);
- if (mt_server_init(&server, loop, STDIN_FILENO) == -1) {
+ if (mt_server_init(&server, loop, STDIN_FILENO) != 0) {
return -1;
}
} mt_server_t;
// init self, add it to loop and make it read data from fd
+// return 0 on success, -1 otherwise
int mt_server_init(mt_server_t *self, struct ev_loop *loop, int fd);
// gett drunc an kil sellf