1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

unix: add shutdown()

As sys/socket.h defines shutdown also, we can't include common.h in unix mocks.
This commit is contained in:
Jan Pochyla 2017-11-08 18:07:33 +01:00
parent 237740de9c
commit cf14717d43
3 changed files with 11 additions and 1 deletions

View File

@ -13,10 +13,13 @@
#include <stdlib.h>
#include <string.h>
#include "../../unix/common.h"
#include "../../trezorhal/usb.h"
#include "../../trezorhal/touch.h"
void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg, const char *file, int line, const char *func);
#define ensure(expr, msg) (((expr) == sectrue) ? (void)0 : __fatal_error(#expr, msg, __FILE__, __LINE__, __func__))
#define TREZOR_UDP_IFACE 0
#define TREZOR_UDP_PORT 21324

View File

@ -31,3 +31,8 @@ void hal_delay(uint32_t ms)
{
usleep(1000 * ms);
}
void shutdown(void)
{
exit(1);
}

View File

@ -9,4 +9,6 @@ void __attribute__((noreturn)) __fatal_error(const char *expr, const char *msg,
void hal_delay(uint32_t ms);
void shutdown(void);
#endif