]> Kevux Git Server - fll/commitdiff
Progress: featureless make
authorKevin Day <thekevinday@gmail.com>
Wed, 27 May 2020 04:52:02 +0000 (23:52 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 27 May 2020 04:52:02 +0000 (23:52 -0500)
Get umask at start (done at start to limit the non-atomic nature of the poorly defined POSIX umask()).

Begin setting up for directory copy operations.

f_file_create() no longer accepts de-reference parameter.

level_3/fake/c/fake.h
level_3/fake/c/main.c
level_3/fake/c/private-build.c
level_3/fake/c/private-skeleton.c

index 5bcb4f5..6ddef5e 100644 (file)
@@ -416,6 +416,7 @@ extern "C" {
 
     f_string_lengths remaining;
     bool process_pipe;
+    mode_t umask;
 
     uint8_t operation;
     uint8_t verbosity;
@@ -477,6 +478,7 @@ extern "C" {
       f_string_lengths_initialize, \
       F_false, \
       0, \
+      0, \
       fake_verbosity_normal, \
       f_string_dynamic_initialize, \
       f_string_dynamics_initialize, \
index e5cb91a..882498f 100644 (file)
@@ -4,6 +4,12 @@ int main(const unsigned long argc, const f_string *argv) {
   const f_console_arguments arguments = { argc, argv };
   fake_data data = fake_data_initialize;
 
+  // @fixme: bad design in POSIX where there is no get umask without setting it.
+  data.umask = umask(0);
+
+  // restore umask.
+  umask(data.umask);
+
   f_status status = fake_main(arguments, &data);
 
   if (F_status_is_error(status)) {
index 676a516..db77d0d 100644 (file)
@@ -366,6 +366,11 @@ extern "C" {
       return status;
     }
 
+    f_directory_statuss failures = f_directory_statuss_initialize;
+    f_directory_mode mode = f_directory_mode_initialize;
+
+    f_macro_directory_mode_set_default_umask(mode, data.umask);
+
     // @todo: may have to process all data intended to be used in parameters, exploding them into console parameters.
     // Steps:
     // 1) copy sources settings to build settings
index 951e7ec..0804aed 100644 (file)
@@ -182,7 +182,7 @@ extern "C" {
         mode = f_file_mode_all_rwx;
       }
 
-      status = f_file_create(path.string, mode, F_true, F_true);
+      status = f_file_create(path.string, mode, F_true);
 
       if (F_status_is_error(status)) {
         if (F_status_set_fine(status) == F_file_found_not) {