aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-07 22:37:12 +0000
committerChristopher Faylor <me@cgf.cx>2003-12-07 22:37:12 +0000
commit2e008fb91f34b5a257305a1e9e42f60fb0aef81d (patch)
treef6c5fd9e3d77b40fbe13f5ae6d6dbc2ebf88324c /winsup/cygwin/path.cc
parent2e3ff06d3c0424e2862afba051c4928d268a21c7 (diff)
downloadnewlib-2e008fb91f34b5a257305a1e9e42f60fb0aef81d.zip
newlib-2e008fb91f34b5a257305a1e9e42f60fb0aef81d.tar.gz
newlib-2e008fb91f34b5a257305a1e9e42f60fb0aef81d.tar.bz2
Change use of BOOL, TRUE, FALSE to bool, true, false, as appropriate,
throughout. * tty.cc (tty::common_init): Remove call to SetKernelObjectSecurity and edit some comments. * cygheap.h (init_cygheap::ctty): Add new element. * devices.in (device::parse): Remove special handling for /dev/tty. * devices.cc: Regenerate. * dtable.cc (build_fh_pc): Don't reset /dev/tty device. Let the device opener do that. * fhandler_termios.cc (tty_min::set_ctty): Redefine to _pinfo class. * fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Avoid setting noninherit flag for ctty. * tty.h: Move BOOLs to bools. (tty_min::set_ctty): Redeclare to _pinfo class. * pinfo.cc (_pinfo::set_ctty): Define new function based on tty_min::set_ctty. Change first argument from tty number to tty_min class. * pinfo.h (_pinfo::set_ctty): Declare. * fhandler_console.cc (fhandler_console::get_tty_stuff): Reflect move of set_ctty to _pinfo class. * fhandler_tty.cc (fhandler_tty_slave::open): Treat FH_TTY specially. Use saved cygheap value if it exists. Otherwise convert to real device and save on first time open. (fhandler_tty_common::dup): Potentially set controlling tty if duping a slave tty. * syscalls.cc (setsid): Close controlling tty in cygheap. * tty.cc: Change some BOOLs to bools.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index a88ad6f..11350d2 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -102,13 +102,13 @@ struct symlink_info
_mode_t mode;
int check (char *path, const suffix_info *suffixes, unsigned opt);
bool parse_device (const char *);
- BOOL case_check (char *path);
+ bool case_check (char *path);
};
int pcheck_case = PCHECK_RELAXED; /* Determines the case check behaviour. */
static char shortcut_header[SHORTCUT_HDR_SIZE];
-static BOOL shortcut_initalized;
+static bool shortcut_initalized;
static void
create_shortcut_header (void)
@@ -123,7 +123,7 @@ create_shortcut_header (void)
shortcut_header[19] = 'F';
shortcut_header[20] = '\f';
shortcut_header[60] = '\001';
- shortcut_initalized = TRUE;
+ shortcut_initalized = true;
}
}
@@ -641,7 +641,7 @@ path_conv::check (const char *src, unsigned opt,
{
if (pcheck_case == PCHECK_STRICT)
{
- case_clash = TRUE;
+ case_clash = true;
error = ENOENT;
goto out;
}
@@ -650,7 +650,7 @@ path_conv::check (const char *src, unsigned opt,
which shall create files to avoid overriding already existing
files with another case. */
if (!component)
- case_clash = TRUE;
+ case_clash = true;
}
if (!(opt & PC_SYM_IGNORE))
{
@@ -898,7 +898,7 @@ digits (const char *name)
return p > name && !*p ? n : -1;
}
-/* Return TRUE if src_path is a valid, internally supported device name.
+/* Return true if src_path is a valid, internally supported device name.
In that case, win32_path gets the corresponding NT device name and
dev is appropriately filled with device information. */
@@ -2195,7 +2195,7 @@ mount_info::del_item (const char *path, unsigned flags, int reg_p)
else
{
slashify (path, pathtmp, 0);
- posix_path_p = TRUE;
+ posix_path_p = true;
}
nofinalslash (pathtmp, pathtmp);
@@ -2378,7 +2378,7 @@ mount (const char *win32_path, const char *posix_path, unsigned flags)
win32_path = NULL;
}
else if (!check_null_empty_str_errno (win32_path))
- res = mount_table->add_item (win32_path, posix_path, flags, TRUE);
+ res = mount_table->add_item (win32_path, posix_path, flags, true);
syscall_printf ("%d = mount (%s, %s, %p)", res, win32_path, posix_path, flags);
return res;
@@ -2415,7 +2415,7 @@ cygwin_umount (const char *path, unsigned flags)
}
else
{
- res = mount_table->del_item (path, flags, TRUE);
+ res = mount_table->del_item (path, flags, true);
}
syscall_printf ("%d = cygwin_umount (%s, %d)", res, path, flags);
@@ -2455,7 +2455,7 @@ get_symlink_ea (const char* frompath, char* buf, int buf_size)
}
/* Save symlink to Extended Attribute */
-BOOL
+bool
set_symlink_ea (const char* frompath, const char* topath)
{
if (!NTWriteEA (frompath, SYMLINK_EA_NAME, topath, strlen (topath) + 1))
@@ -2463,14 +2463,14 @@ set_symlink_ea (const char* frompath, const char* topath)
debug_printf ("Cannot save symlink in EA");
return false;
}
- return TRUE;
+ return true;
}
/* Create a symlink from FROMPATH to TOPATH. */
/* If TRUE create symlinks as Windows shortcuts, if false create symlinks
as normal files with magic number and system bit set. */
-int allow_winsymlinks = TRUE;
+bool allow_winsymlinks = true;
extern "C" int
symlink (const char *topath, const char *frompath)
@@ -2642,7 +2642,7 @@ done:
return res;
}
-static BOOL
+static bool
cmp_shortcut_header (const char *file_header)
{
create_shortcut_header ();
@@ -3061,7 +3061,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
Dont't call if pcheck_case == PCHECK_RELAXED.
*/
-BOOL
+bool
symlink_info::case_check (char *path)
{
WIN32_FIND_DATA data;
@@ -3082,7 +3082,7 @@ symlink_info::case_check (char *path)
/* If that part of the component exists, check the case. */
if (strcmp (c, data.cFileName))
{
- case_clash = TRUE;
+ case_clash = true;
/* If check is set to STRICT, a wrong case results
in returning a ENOENT. */
@@ -3094,7 +3094,7 @@ symlink_info::case_check (char *path)
strcpy (c, data.cFileName);
}
}
- return TRUE;
+ return true;
}
/* readlink system call */