rktio: make append mode imply can-exist on Windows
This commit is contained in:
parent
a13bfd25d0
commit
b96fc45133
|
@ -114,6 +114,7 @@ typedef struct rktio_fd_t rktio_fd_t;
|
|||
#define RKTIO_OPEN_APPEND (1<<4)
|
||||
#define RKTIO_OPEN_MUST_EXIST (1<<5)
|
||||
#define RKTIO_OPEN_CAN_EXIST (1<<6)
|
||||
/* `RKTIO_OPEN_APPEND` implies `RKTIO_OPEN_CAN_EXIST` */
|
||||
|
||||
/* Used for `rktio_system_fd`: */
|
||||
#define RKTIO_OPEN_SOCKET (1<<7)
|
||||
|
|
|
@ -172,7 +172,7 @@ static rktio_fd_t *open_write(rktio_t *rktio, const char *filename, int modes)
|
|||
hmode = TRUNCATE_EXISTING;
|
||||
else
|
||||
hmode = OPEN_EXISTING;
|
||||
} else if (modes & RKTIO_OPEN_CAN_EXIST)
|
||||
} else if (modes & (RKTIO_OPEN_CAN_EXIST | RKTIO_OPEN_APPEND))
|
||||
hmode = OPEN_ALWAYS;
|
||||
else
|
||||
hmode = CREATE_NEW;
|
||||
|
|
Loading…
Reference in New Issue
Block a user