1
0
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:
Witold Filipczyk 2006-05-18 21:46:42 +02:00 committed by Witold Filipczyk
parent 739298b46d
commit 3dc145bde2
4 changed files with 12 additions and 5 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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;
}

View File

@ -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