mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Changes related to Win32 port. S_IRWXG and S_IRWXO were undefined
under crossmingw32. init_static_version must be called after init_options because ELinks wanted to read "verbose" option before it was initialized.
This commit is contained in:
parent
739298b46d
commit
3dc145bde2
@ -111,7 +111,6 @@ init(void)
|
||||
enum retval ret;
|
||||
|
||||
init_osdep();
|
||||
init_static_version();
|
||||
check_cwd();
|
||||
|
||||
#ifdef CONFIG_NLS
|
||||
@ -119,14 +118,14 @@ init(void)
|
||||
textdomain(PACKAGE);
|
||||
set_language(0);
|
||||
#endif
|
||||
|
||||
init_event();
|
||||
|
||||
init_charsets_lookup();
|
||||
init_colors_lookup();
|
||||
init_modules(main_modules);
|
||||
|
||||
init_options();
|
||||
init_static_version();
|
||||
|
||||
register_modules_options(main_modules);
|
||||
register_modules_options(builtin_modules);
|
||||
set_sigcld();
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "main/timer.h" /* timer_id_T */
|
||||
#include "network/state.h"
|
||||
#include "util/lists.h"
|
||||
#include <stdio.h>
|
||||
|
||||
struct download;
|
||||
struct socket;
|
||||
|
@ -272,11 +272,13 @@ file_read_line(unsigned char *line, size_t *size, FILE *file, int *lineno)
|
||||
int
|
||||
safe_mkstemp(unsigned char *template)
|
||||
{
|
||||
#ifndef CONFIG_OS_WIN32
|
||||
mode_t saved_mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
|
||||
#endif
|
||||
int fd = mkstemp(template);
|
||||
|
||||
#ifndef CONFIG_OS_WIN32
|
||||
umask(saved_mask);
|
||||
|
||||
#endif
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,12 @@ end:
|
||||
struct secure_save_info *
|
||||
secure_open(unsigned char *file_name)
|
||||
{
|
||||
#ifdef CONFIG_OS_WIN32
|
||||
/* There is neither S_IRWXG nor S_IRWXO under crossmingw32-gcc */
|
||||
return secure_open_umask(file_name, 0177);
|
||||
#else
|
||||
return secure_open_umask(file_name, S_IXUSR | S_IRWXG | S_IRWXO);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Close a file opened with secure_open, and return 0 on success, errno
|
||||
|
Loading…
Reference in New Issue
Block a user