Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-09-06 05:56:17 +0400
committerChristopher Faylor <me@cgf.cx>2000-09-06 05:56:17 +0400
commit3e0576957bc97a8fe16b3d8011b3793d5850b9dd (patch)
tree21fe70a77d20a3d307a55f7f626265f47d0609d2 /winsup
parente321565bbcb9b969975f985160da076cc586ed94 (diff)
* path.cc (normalize_posix_path): Deal with error return from cygcwd.get.
(normalize_win32_path): Ditto. (mount_info::conv_to_win32_path): Ditto. (cwdstuff::get): Set buf to NULL on error.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/path.cc14
2 files changed, 17 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index e6be90e20..4df56a562 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+Tue Sep 5 21:36:15 2000 Christopher Faylor <cgf@cygnus.com>
+
+ * path.cc (normalize_posix_path): Deal with error return from cygcwd.get.
+ (normalize_win32_path): Ditto.
+ (mount_info::conv_to_win32_path): Ditto.
+ (cwdstuff::get): Set buf to NULL on error.
+
Tue Sep 5 17:49:34 2000 Christopher Faylor <cgf@cygnus.com>
* path.cc (readlink): 'max' should be a 'min' or we'll suffer
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 2033d257c..705603cc7 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -536,7 +536,8 @@ normalize_posix_path (const char *src, char *dst)
if (!isslash (src[0]))
{
char cwd[MAX_PATH];
- cygcwd.get (cwd); /* FIXME: check return value */
+ if (!cygcwd.get (cwd))
+ return get_errno ();
if (strlen (cwd) + 1 + strlen (src) >= MAX_PATH)
{
debug_printf ("ENAMETOOLONG = normalize_posix_path (%s)", src);
@@ -639,7 +640,8 @@ normalize_win32_path (const char *src, char *dst)
if (!SLASH_P (src[0]) && strchr (src, ':') == NULL)
{
char cwd[MAX_PATH];
- cygcwd.get (cwd, 0); /* FIXME: check return value */
+ if (!cygcwd.get (cwd, 0))
+ return get_errno ();
if (strlen (cwd) + 1 + strlen (src) >= MAX_PATH)
{
debug_printf ("ENAMETOOLONG = normalize_win32_path (%s)", src);
@@ -1043,7 +1045,8 @@ fillin:
else if (isrelpath)
{
char cwd_win32[MAX_PATH];
- cygcwd.get (cwd_win32, 0); /* FIXME: check return value someday */
+ if (!cygcwd.get (cwd_win32, 0))
+ return get_errno ();
unsigned cwdlen = strlen (cwd_win32);
if (path_prefix_p (cwd_win32, dst, cwdlen))
{
@@ -2950,7 +2953,10 @@ cwdstuff::get (char *buf, int need_posix, int with_chroot, unsigned ulen)
debug_printf("myself->root: %s, posix: %s", myself->root, posix);
if (strlen (tocopy) >= ulen)
- set_errno (ERANGE);
+ {
+ set_errno (ERANGE);
+ buf = NULL;
+ }
else
{
strcpy (buf, tocopy);