mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04: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;
|
enum retval ret;
|
||||||
|
|
||||||
init_osdep();
|
init_osdep();
|
||||||
init_static_version();
|
|
||||||
check_cwd();
|
check_cwd();
|
||||||
|
|
||||||
#ifdef CONFIG_NLS
|
#ifdef CONFIG_NLS
|
||||||
@ -119,14 +118,14 @@ init(void)
|
|||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
set_language(0);
|
set_language(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
init_event();
|
init_event();
|
||||||
|
|
||||||
init_charsets_lookup();
|
init_charsets_lookup();
|
||||||
init_colors_lookup();
|
init_colors_lookup();
|
||||||
init_modules(main_modules);
|
init_modules(main_modules);
|
||||||
|
|
||||||
init_options();
|
init_options();
|
||||||
|
init_static_version();
|
||||||
|
|
||||||
register_modules_options(main_modules);
|
register_modules_options(main_modules);
|
||||||
register_modules_options(builtin_modules);
|
register_modules_options(builtin_modules);
|
||||||
set_sigcld();
|
set_sigcld();
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "main/timer.h" /* timer_id_T */
|
#include "main/timer.h" /* timer_id_T */
|
||||||
#include "network/state.h"
|
#include "network/state.h"
|
||||||
#include "util/lists.h"
|
#include "util/lists.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
struct download;
|
struct download;
|
||||||
struct socket;
|
struct socket;
|
||||||
|
@ -272,11 +272,13 @@ file_read_line(unsigned char *line, size_t *size, FILE *file, int *lineno)
|
|||||||
int
|
int
|
||||||
safe_mkstemp(unsigned char *template)
|
safe_mkstemp(unsigned char *template)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_OS_WIN32
|
||||||
mode_t saved_mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
|
mode_t saved_mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
|
||||||
|
#endif
|
||||||
int fd = mkstemp(template);
|
int fd = mkstemp(template);
|
||||||
|
#ifndef CONFIG_OS_WIN32
|
||||||
umask(saved_mask);
|
umask(saved_mask);
|
||||||
|
#endif
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,7 +206,12 @@ end:
|
|||||||
struct secure_save_info *
|
struct secure_save_info *
|
||||||
secure_open(unsigned char *file_name)
|
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);
|
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
|
/* Close a file opened with secure_open, and return 0 on success, errno
|
||||||
|
Loading…
x
Reference in New Issue
Block a user