From fbec070aa4a8f7391737ffef733361a3e1a4a1ec Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 24 Jan 2020 19:00:49 -0500 Subject: [PATCH] rename creat to create This was changed as part of snapshot_preview2. Refs: https://github.com/cjihrig/uvwasi/issues/59 --- README.md | 4 ++-- include/wasi_types.h | 2 +- src/uvwasi.c | 2 +- test/test-basic-file-io.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bb53afa..11ec5db 100644 --- a/README.md +++ b/README.md @@ -1964,7 +1964,7 @@ Used by [`uvwasi_path_open()`](#path_open). Possible values: -- **`UVWASI_O_CREAT`** +- **`UVWASI_O_CREATE`** Create file if it does not exist. @@ -2066,7 +2066,7 @@ Possible values: - **`UVWASI_RIGHT_PATH_CREATE_FILE`** If [`UVWASI_RIGHT_PATH_OPEN`](#rights.path_open) is set, the right to invoke - [`uvwasi_path_open()`](#path_open) with [`UVWASI_O_CREAT`](#oflags.creat). + [`uvwasi_path_open()`](#path_open) with [`UVWASI_O_CREATE`](#oflags.create). - **`UVWASI_RIGHT_PATH_LINK_SOURCE`** diff --git a/include/wasi_types.h b/include/wasi_types.h index ec10136..8f5748f 100644 --- a/include/wasi_types.h +++ b/include/wasi_types.h @@ -161,7 +161,7 @@ typedef uint32_t uvwasi_lookupflags_t; /* Bitfield */ #define UVWASI_LOOKUP_SYMLINK_FOLLOW (1 << 0) typedef uint16_t uvwasi_oflags_t; /* Bitfield */ -#define UVWASI_O_CREAT (1 << 0) +#define UVWASI_O_CREATE (1 << 0) #define UVWASI_O_DIRECTORY (1 << 1) #define UVWASI_O_EXCL (1 << 2) #define UVWASI_O_TRUNC (1 << 3) diff --git a/src/uvwasi.c b/src/uvwasi.c index 5ad94f5..c08d090 100644 --- a/src/uvwasi.c +++ b/src/uvwasi.c @@ -1891,7 +1891,7 @@ uvwasi_errno_t uvwasi_path_open(uvwasi_t* uvwasi, needed_base = UVWASI_RIGHT_PATH_OPEN; needed_inheriting = fs_rights_base | fs_rights_inheriting; - if ((o_flags & UVWASI_O_CREAT) != 0) { + if ((o_flags & UVWASI_O_CREATE) != 0) { flags |= UV_FS_O_CREAT; needed_base |= UVWASI_RIGHT_PATH_CREATE_FILE; } diff --git a/test/test-basic-file-io.c b/test/test-basic-file-io.c index 492408c..05a5f67 100644 --- a/test/test-basic-file-io.c +++ b/test/test-basic-file-io.c @@ -60,7 +60,7 @@ int main(void) { 1, path, strlen(path) + 1, - UVWASI_O_CREAT, + UVWASI_O_CREATE, fs_rights_base, 0, 0,