1. 21 May, 2018 8 commits
    • Daniel Black's avatar
      MDEV-15635 mysys: THR_LOCK_open reduce usage · 59785df5
      Daniel Black authored
      Change the following to statistic counters:
      * my_file_opened
      * my_file_total_opened
      * my_stream_opened
      * my_tmp_file_created
      
      There is one non-statistics use of my_file_opened/my_stream_opened
      in my_end which prints a warning if we shutdown and its still open.
      It seems excessive to hold locks to prevent this warning.
      
      A file descriptor is already a unique element per process - in Windows,
      protection occurs at fd allocation using THR_LOCK_open in my_win_{,f}open
      and in other OSes, a unique fd to file map exists at the OS level.
      So accesses to my_file_info[fd] don't need to be protected by the
      THR_LOCK_open.
      
      my_close/my_fclose where restructured to clear out the my_file_info
      before the close/my_win_close/my_win_fclose. After these calls another
      thread could gain the same file descriptor. So for Windows this
      the file_info elements available to the my_win_{,f}_open are released
      during the invalidate_fd call within my_win_close. No locking is needed
      as the my_win_{,f}open is searching for a invalidate entry which is
      determined by a single value change.
      
      my_fclose also changed for non-Windows to retry closing if EINTR was
      returned, same as my_close.
      
      Closes #657
      59785df5
    • Daniel Black's avatar
      MDEV-8743: use mkostemp when available with O_CLOEXEC · 20fadaac
      Daniel Black authored
      Closes #639
      20fadaac
    • Sergei Golubchik's avatar
      cleanup: report_error() in sql_plugin.cc · f56d1417
      Sergei Golubchik authored
      it's redundant. remove it, use my_error() directly.
      f56d1417
    • Sergei Golubchik's avatar
      cleanup: create_temp_file() · 44b7f5f3
      Sergei Golubchik authored
      simplify. move common code inside, specify common flags inside,
      rewrite dead code (`if (mode & O_TEMPORARY)` on Linux, where
      `O_TEMPORARY` is always 0) to actually do something.
      44b7f5f3
    • Daniel Black's avatar
      MDEV-15583 create_temp_file: remove tempnam implementation · 7e45b7ac
      Daniel Black authored
      In the spirit of the man page "Never use this function."
      lets purge off this implementation. mkstemp is a widely
      available alternative.
      
      Closes #661.
      7e45b7ac
    • Jia Zhouyang's avatar
      MDEV-15550 Add error handling for fopen · d7a047c4
      Jia Zhouyang authored
      Print error message and return when fopen fails.
      
      Closes #634
      d7a047c4
    • Alexander Kuleshov's avatar
      MDEV-15513 use EVP_MD_CTX_{new,free} instead of EVP_MD_CTX_{create, destroy} · b5a6f823
      Alexander Kuleshov authored
      for consistency with EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free().
      
      As the EVP_DIGESTINIT(3) man page says:
      
      EVP_MD_CTX_create() and EVP_MD_CTX_destroy() were renamed to
      EVP_MD_CTX_new() and EVP_MD_CTX_free() in OpenSSL 1.1.
      
      Closes #621
      b5a6f823
    • Vladislav Vaintroub's avatar
      update C/C · f51e5e45
      Vladislav Vaintroub authored
      f51e5e45
  2. 19 May, 2018 12 commits
  3. 18 May, 2018 8 commits
  4. 17 May, 2018 12 commits