mirror of git://gcc.gnu.org/git/gcc.git
chmod.c (chmod_func): On MinGW, don't set is_dir
2012-06-01 Tobias Burnus <burnus@net-b.de> * intrinsics/chmod.c (chmod_func): On MinGW, don't set is_dir * and fix octal-mode handling. * io/unit.c (get_internal_unit): Add cast. * io/unix.c (min): Undef "min" before defining it. * runtime/backtrace.c (show_backtrace): Move label into ifndef __MINGW__ block. From-SVN: r188098
This commit is contained in:
parent
62330f08cb
commit
7ed26a671c
|
@ -1,3 +1,12 @@
|
||||||
|
2012-06-01 Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
|
* intrinsics/chmod.c (chmod_func): On MinGW, don't set is_dir and
|
||||||
|
fix octal-mode handling.
|
||||||
|
* io/unit.c (get_internal_unit): Add cast.
|
||||||
|
* io/unix.c (min): Undef "min" before defining it.
|
||||||
|
* runtime/backtrace.c (show_backtrace): Move label into
|
||||||
|
ifndef __MINGW__ block.
|
||||||
|
|
||||||
2012-05-31 Benjamin Kosnik <bkoz@redhat.com>
|
2012-05-31 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
PR libstdc++/51007
|
PR libstdc++/51007
|
||||||
|
|
|
@ -74,7 +74,10 @@ chmod_func (char *name, char *mode, gfc_charlen_type name_len,
|
||||||
bool ugo[3];
|
bool ugo[3];
|
||||||
bool rwxXstugo[9];
|
bool rwxXstugo[9];
|
||||||
int set_mode, part;
|
int set_mode, part;
|
||||||
bool is_dir, honor_umask, continue_clause = false;
|
bool honor_umask, continue_clause = false;
|
||||||
|
#ifndef __MINGW32__
|
||||||
|
bool is_dir;
|
||||||
|
#endif
|
||||||
mode_t mode_mask, file_mode, new_mode;
|
mode_t mode_mask, file_mode, new_mode;
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
|
|
||||||
|
@ -93,10 +96,10 @@ chmod_func (char *name, char *mode, gfc_charlen_type name_len,
|
||||||
if (mode[0] >= '0' && mode[0] <= '9')
|
if (mode[0] >= '0' && mode[0] <= '9')
|
||||||
{
|
{
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
unsigned mode;
|
unsigned fmode;
|
||||||
if (sscanf (mode, "%o", &mode) != 1)
|
if (sscanf (mode, "%o", &fmode) != 1)
|
||||||
return 1;
|
return 1;
|
||||||
file_mode = (mode_t) mode;
|
file_mode = (mode_t) fmode;
|
||||||
#else
|
#else
|
||||||
if (sscanf (mode, "%o", &file_mode) != 1)
|
if (sscanf (mode, "%o", &file_mode) != 1)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -109,7 +112,9 @@ chmod_func (char *name, char *mode, gfc_charlen_type name_len,
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
file_mode = stat_buf.st_mode & ~S_IFMT;
|
file_mode = stat_buf.st_mode & ~S_IFMT;
|
||||||
|
#ifndef __MINGW32__
|
||||||
is_dir = stat_buf.st_mode & S_IFDIR;
|
is_dir = stat_buf.st_mode & S_IFDIR;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UMASK
|
#ifdef HAVE_UMASK
|
||||||
/* Obtain the umask without distroying the setting. */
|
/* Obtain the umask without distroying the setting. */
|
||||||
|
|
|
@ -430,7 +430,8 @@ get_internal_unit (st_parameter_dt *dtp)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dtp->internal_unit_len =
|
dtp->internal_unit_len =
|
||||||
string_len_trim_char4 (dtp->internal_unit_len, dtp->internal_unit);
|
string_len_trim_char4 (dtp->internal_unit_len,
|
||||||
|
(const gfc_char4_t*) dtp->internal_unit);
|
||||||
iunit->recl = dtp->internal_unit_len;
|
iunit->recl = dtp->internal_unit_len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,13 +41,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
|
||||||
/* min macro that evaluates its arguments only once. */
|
|
||||||
#define min(a,b) \
|
|
||||||
({ typeof (a) _a = (a); \
|
|
||||||
typeof (b) _b = (b); \
|
|
||||||
_a < _b ? _a : _b; })
|
|
||||||
|
|
||||||
|
|
||||||
/* For mingw, we don't identify files by their inode number, but by a
|
/* For mingw, we don't identify files by their inode number, but by a
|
||||||
64-bit identifier created from a BY_HANDLE_FILE_INFORMATION. */
|
64-bit identifier created from a BY_HANDLE_FILE_INFORMATION. */
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
|
@ -106,8 +99,19 @@ id_from_fd (const int fd)
|
||||||
return id_from_handle ((HANDLE) _get_osfhandle (fd));
|
return id_from_handle ((HANDLE) _get_osfhandle (fd));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* HAVE_WORKING_STAT */
|
||||||
|
#endif /* __MINGW32__ */
|
||||||
|
|
||||||
|
|
||||||
|
/* min macro that evaluates its arguments only once. */
|
||||||
|
#ifdef min
|
||||||
|
#undef min
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
#define min(a,b) \
|
||||||
|
({ typeof (a) _a = (a); \
|
||||||
|
typeof (b) _b = (b); \
|
||||||
|
_a < _b ? _a : _b; })
|
||||||
|
|
||||||
#ifndef PATH_MAX
|
#ifndef PATH_MAX
|
||||||
#define PATH_MAX 1024
|
#define PATH_MAX 1024
|
||||||
|
|
|
@ -270,9 +270,9 @@ fallback:
|
||||||
}
|
}
|
||||||
while (0);
|
while (0);
|
||||||
|
|
||||||
|
fallback_noerr:
|
||||||
#endif /* CAN_PIPE */
|
#endif /* CAN_PIPE */
|
||||||
|
|
||||||
fallback_noerr:
|
|
||||||
/* Fallback to the simple backtrace without addr2line. */
|
/* Fallback to the simple backtrace without addr2line. */
|
||||||
state.direct_output = 1;
|
state.direct_output = 1;
|
||||||
_Unwind_Backtrace (trace_function, &state);
|
_Unwind_Backtrace (trace_function, &state);
|
||||||
|
|
Loading…
Reference in New Issue