unix: Use common RAISE_ERRNO macro from mphalport.h.
This commit is contained in:
parent
503089ea9d
commit
016dba0e98
@ -37,6 +37,7 @@
|
|||||||
#include "py/nlr.h"
|
#include "py/nlr.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/objtuple.h"
|
#include "py/objtuple.h"
|
||||||
|
#include "py/mphal.h"
|
||||||
#include "extmod/misc.h"
|
#include "extmod/misc.h"
|
||||||
|
|
||||||
// Can't include this, as FATFS structure definition is required,
|
// Can't include this, as FATFS structure definition is required,
|
||||||
@ -51,10 +52,6 @@ extern const mp_obj_type_t mp_fat_vfs_type;
|
|||||||
#define USE_STATFS 1
|
#define USE_STATFS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define RAISE_ERRNO(err_flag, error_val) \
|
|
||||||
{ if (err_flag == -1) \
|
|
||||||
{ mp_raise_OSError(error_val); } }
|
|
||||||
|
|
||||||
STATIC mp_obj_t mod_os_stat(mp_obj_t path_in) {
|
STATIC mp_obj_t mod_os_stat(mp_obj_t path_in) {
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
mp_uint_t len;
|
mp_uint_t len;
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
#include "py/builtin.h"
|
#include "py/builtin.h"
|
||||||
|
#include "py/mphal.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The idea of this module is to implement reasonable minimum of
|
The idea of this module is to implement reasonable minimum of
|
||||||
@ -72,10 +73,6 @@ typedef struct _mp_obj_socket_t {
|
|||||||
const mp_obj_type_t mp_type_socket;
|
const mp_obj_type_t mp_type_socket;
|
||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
#define RAISE_ERRNO(err_flag, error_val) \
|
|
||||||
{ if (err_flag == -1) \
|
|
||||||
{ mp_raise_OSError(error_val); } }
|
|
||||||
|
|
||||||
static inline mp_obj_t mp_obj_from_sockaddr(const struct sockaddr *addr, socklen_t len) {
|
static inline mp_obj_t mp_obj_from_sockaddr(const struct sockaddr *addr, socklen_t len) {
|
||||||
return mp_obj_new_bytes((const byte *)addr, len);
|
return mp_obj_new_bytes((const byte *)addr, len);
|
||||||
}
|
}
|
||||||
|
@ -29,13 +29,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "py/nlr.h"
|
|
||||||
#include "py/objlist.h"
|
#include "py/objlist.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
#include "py/mphal.h"
|
||||||
#define RAISE_ERRNO(err_flag, error_val) \
|
|
||||||
{ if (err_flag == -1) \
|
|
||||||
{ mp_raise_OSError(error_val); } }
|
|
||||||
|
|
||||||
STATIC mp_obj_t mod_termios_tcgetattr(mp_obj_t fd_in) {
|
STATIC mp_obj_t mod_termios_tcgetattr(mp_obj_t fd_in) {
|
||||||
struct termios term;
|
struct termios term;
|
||||||
|
Loading…
Reference in New Issue
Block a user