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
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-12-03 23:09:33 +0300
committerChristopher Faylor <me@cgf.cx>2001-12-03 23:09:33 +0300
commit7543995b74deea91ce4d3f793f240c2d0c6c1b1f (patch)
treea0bef4b7742140b9ae4a3768fb88bca020586965
parent6dfcb5a3a9bb858d36c9ab0545ac5ea8726897ba (diff)
* net.cc (cygwin_getsockopt): Allow NULL optval.
* path.cc (mount_info::read_cygdrive_info_from_registry): Don't write cygdrive to registry if it doesn't exist.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/net.cc16
-rw-r--r--winsup/cygwin/path.cc25
3 files changed, 22 insertions, 26 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 40aaba692..6f8fe5b98 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,12 @@
2001-12-03 Christopher Faylor <cgf@redhat.com>
+ * net.cc (cygwin_getsockopt): Allow NULL optval.
+
+ * path.cc (mount_info::read_cygdrive_info_from_registry): Don't write
+ cygdrive to registry if it doesn't exist.
+
+2001-12-03 Christopher Faylor <cgf@redhat.com>
+
* path.cc (mount_info::conv_to_win32_path): Avoid returning error if
cygdrive == '/'.
(mount_info::cygdrive_win32_path): Return 0 if invalid cygdrive path.
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index ca19fae04..512dd6f73 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -613,11 +613,11 @@ static int get_inet_addr (const struct sockaddr *in, int inlen,
/* exported as sendto: standards? */
extern "C" int
cygwin_sendto (int fd,
- const void *buf,
- int len,
- unsigned int flags,
- const struct sockaddr *to,
- int tolen)
+ const void *buf,
+ int len,
+ unsigned int flags,
+ const struct sockaddr *to,
+ int tolen)
{
int res;
wsock_event wsock_evt;
@@ -684,7 +684,7 @@ cygwin_recvfrom (int fd,
if (__check_null_invalid_struct_errno (buf, (unsigned) len)
|| check_null_invalid_struct_errno (fromlen)
- || __check_null_invalid_struct_errno (from, (unsigned) *fromlen)
+ || (from && __check_null_invalid_struct_errno (from, (unsigned) *fromlen))
|| !h)
res = -1;
else
@@ -735,7 +735,7 @@ cygwin_setsockopt (int fd,
int res = -1;
const char *name = "error";
- if (!__check_invalid_read_ptr_errno (optval, optlen) && h)
+ if ((!optval || !__check_invalid_read_ptr_errno (optval, optlen)) && h)
{
/* For the following debug_printf */
switch (optname)
@@ -799,7 +799,7 @@ cygwin_getsockopt (int fd,
int res = -1;
const char *name = "error";
if (!check_null_invalid_struct_errno (optlen)
- && !__check_null_invalid_struct_errno (optval, (unsigned) optlen)
+ && (!optval || !__check_null_invalid_struct_errno (optval, (unsigned) optlen))
&& h)
{
/* For the following debug_printf */
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 4c295f247..4938b46e2 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1867,8 +1867,7 @@ mount_info::read_cygdrive_info_from_registry ()
/* reg_key for user path prefix in HKEY_CURRENT_USER. */
reg_key r;
- if (r.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, cygdrive, sizeof (cygdrive),
- "") != 0)
+ if (r.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, cygdrive, sizeof (cygdrive), "") != 0)
{
/* Didn't find the user path prefix so check the system path prefix. */
@@ -1878,22 +1877,12 @@ mount_info::read_cygdrive_info_from_registry ()
CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME,
NULL);
- if (r2.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, cygdrive, sizeof (cygdrive),
- "") != 0)
- {
- /* Didn't find either so write the default to the registry and use it.
- NOTE: We are writing and using the user path prefix. */
- write_cygdrive_info_to_registry (CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX,
- MOUNT_AUTO);
- }
- else
- {
- /* Fetch system cygdrive_flags from registry; returns MOUNT_AUTO on
- error. */
- cygdrive_flags = r2.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_AUTO);
- slashify (cygdrive, cygdrive, 1);
- cygdrive_len = strlen(cygdrive);
- }
+ if (r2.get_string (CYGWIN_INFO_CYGDRIVE_PREFIX, cygdrive,
+ sizeof (cygdrive), ""))
+ strcpy (cygdrive, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX);
+ cygdrive_flags = r2.get_int (CYGWIN_INFO_CYGDRIVE_FLAGS, MOUNT_AUTO);
+ slashify (cygdrive, cygdrive, 1);
+ cygdrive_len = strlen (cygdrive);
}
else
{