Changeset 3389 for trunk/src/kmk/main.c


Ignore:
Timestamp:
Jun 26, 2020, 7:16:26 PM (5 years ago)
Author:
bird
Message:

kmk: Avoid setting umask just to get it, store the current value in a global variable (g_fUMask). The umask(0777) call in cp.c raced other code (kmk_append) that created files and directories, leaving us with read-only files sometimes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/main.c

    r3357 r3389  
    821821struct output make_sync;
    822822
     823#ifdef KMK
     824/** Current umask() value. */
     825mode_t g_fUMask = 0022;
     826#endif
     827
    823828
    824829
     
    17691774#endif
    17701775
     1776#ifdef KMK
     1777  /* Get the incoming umask so we don't have to modify it later to get it. */
     1778  umask(g_fUMask = umask(0077));
     1779#endif
     1780
    17711781#ifdef CONFIG_NEW_WIN32_CTRL_EVENT
    17721782  /* bird: dispatch signals in our own way to try avoid deadlocks. */
Note: See TracChangeset for help on using the changeset viewer.