[njs] File flags table cleanup.

Dmitry Volyntsev xeioex at nginx.com
Wed Jul 14 13:19:52 UTC 2021


details:   https://hg.nginx.org/njs/rev/1cfcce81e4e9
branches:  
changeset: 1678:1cfcce81e4e9
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Jul 14 13:18:56 2021 +0000
description:
File flags table cleanup.

diffstat:

 src/njs_fs.c |  29 +++++++++++------------------
 1 files changed, 11 insertions(+), 18 deletions(-)

diffs (41 lines):

diff -r e37a80fac86f -r 1cfcce81e4e9 src/njs_fs.c
--- a/src/njs_fs.c	Tue Jul 13 15:22:24 2021 +0000
+++ b/src/njs_fs.c	Wed Jul 14 13:18:56 2021 +0000
@@ -106,26 +106,19 @@ static njs_int_t njs_fs_dirent_create(nj
     njs_value_t *type, njs_value_t *retval);
 
 static njs_fs_entry_t njs_flags_table[] = {
+    { njs_str("a"),   O_APPEND | O_CREAT | O_WRONLY },
+    { njs_str("a+"),  O_APPEND | O_CREAT | O_RDWR },
+    { njs_str("as"),  O_APPEND | O_CREAT | O_SYNC | O_WRONLY },
+    { njs_str("as+"), O_APPEND | O_CREAT | O_RDWR | O_SYNC },
+    { njs_str("ax"),  O_APPEND | O_CREAT | O_EXCL | O_WRONLY },
+    { njs_str("ax+"), O_APPEND | O_CREAT | O_EXCL | O_RDWR },
     { njs_str("r"),   O_RDONLY },
     { njs_str("r+"),  O_RDWR },
-    { njs_str("w"),   O_TRUNC  | O_CREAT  | O_WRONLY },
-    { njs_str("w+"),  O_TRUNC  | O_CREAT  | O_RDWR },
-    { njs_str("a"),   O_APPEND | O_CREAT  | O_WRONLY },
-    { njs_str("a+"),  O_APPEND | O_CREAT  | O_RDWR },
-    { njs_str("as"),  O_SYNC   | O_APPEND | O_CREAT  | O_WRONLY },
-    { njs_str("as+"), O_SYNC   | O_APPEND | O_CREAT  | O_RDWR },
-    { njs_str("rs"),  O_SYNC   | O_RDONLY },
-    { njs_str("sr"),  O_SYNC   | O_RDONLY },
-    { njs_str("wx"),  O_TRUNC  | O_CREAT  | O_EXCL | O_WRONLY },
-    { njs_str("xw"),  O_TRUNC  | O_CREAT  | O_EXCL | O_WRONLY },
-    { njs_str("ax"),  O_APPEND | O_CREAT  | O_EXCL | O_WRONLY },
-    { njs_str("xa"),  O_APPEND | O_CREAT  | O_EXCL | O_WRONLY },
-    { njs_str("rs+"), O_SYNC   | O_RDWR },
-    { njs_str("sr+"), O_SYNC   | O_RDWR },
-    { njs_str("wx+"), O_TRUNC  | O_CREAT  | O_EXCL | O_RDWR },
-    { njs_str("xw+"), O_TRUNC  | O_CREAT  | O_EXCL | O_RDWR },
-    { njs_str("ax+"), O_APPEND | O_CREAT  | O_EXCL | O_RDWR },
-    { njs_str("xa+"), O_APPEND | O_CREAT  | O_EXCL | O_RDWR },
+    { njs_str("rs+"), O_RDWR   | O_SYNC },
+    { njs_str("w"),   O_CREAT  | O_TRUNC | O_WRONLY },
+    { njs_str("w+"),  O_CREAT  | O_TRUNC | O_RDWR },
+    { njs_str("wx"),  O_CREAT  | O_TRUNC | O_EXCL | O_WRONLY },
+    { njs_str("wx+"), O_CREAT  | O_TRUNC | O_EXCL | O_RDWR },
     { njs_null_str, 0 }
 };
 


More information about the nginx-devel mailing list