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:
authorCorinna Vinschen <corinna@vinschen.de>2014-02-07 00:38:35 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-02-07 00:38:35 +0400
commitabbe1f5320881ec7da114a4e0b6d17045d6b5500 (patch)
tree19a806f7d195cc35873a287f58ed285f2492ed20 /winsup/cygwin
parent46913a8290408f9321791c0ee00b786c4f767b75 (diff)
* fhandler_disk_file.cc (fhandler_disk_file::fchown): Fix typo in
comment. * mount.cc (mount_info::from_fstab): Use tmp_pathbuf rather than stack for big local buffer. * net.cc (cygwin_gethostname): Call GetComputerNameExA rather than GetComputerNameA if gethostname failed. * shared.cc (user_info::initialize): Fix formatting. * include/sys/file.h: Define flock and accompanying macros if not already defined in sys/_default_fcntl.h.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog12
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc4
-rw-r--r--winsup/cygwin/include/sys/file.h12
-rw-r--r--winsup/cygwin/mount.cc11
-rw-r--r--winsup/cygwin/net.cc4
-rw-r--r--winsup/cygwin/shared.cc4
6 files changed, 36 insertions, 11 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 815d3e85d..d2e188499 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,15 @@
+2014-02-06 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_disk_file.cc (fhandler_disk_file::fchown): Fix typo in
+ comment.
+ * mount.cc (mount_info::from_fstab): Use tmp_pathbuf rather than
+ stack for big local buffer.
+ * net.cc (cygwin_gethostname): Call GetComputerNameExA rather than
+ GetComputerNameA if gethostname failed.
+ * shared.cc (user_info::initialize): Fix formatting.
+ * include/sys/file.h: Define flock and accompanying macros if not
+ already defined in sys/_default_fcntl.h.
+
2014-02-04 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 29.
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index ebdc806e2..8f4720e99 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1,7 +1,7 @@
/* fhandler_disk_file.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
This file is part of Cygwin.
@@ -928,7 +928,7 @@ fhandler_disk_file::fchown (uid_t uid, gid_t gid)
if (pc.issymlink ())
attrib = S_IFLNK | STD_RBITS | STD_WBITS;
res = set_file_attribute (get_handle (), pc, uid, gid, attrib);
- /* If you're running a Samba server which has no winbidd running, the
+ /* If you're running a Samba server which has no winbind running, the
uid<->SID mapping is disfunctional. Even trying to chown to your
own account fails since the account used on the server is the UNIX
account which gets used for the standard user mapping. This is a
diff --git a/winsup/cygwin/include/sys/file.h b/winsup/cygwin/include/sys/file.h
index 5730babbc..9b72ee9c2 100644
--- a/winsup/cygwin/include/sys/file.h
+++ b/winsup/cygwin/include/sys/file.h
@@ -31,4 +31,16 @@
#define L_INCR SEEK_CUR
#define L_XTND SEEK_END
+/* Including <sys/file.h> always defines flock & macros. */
+#if __BSD_VISIBLE - 0 == 0
+
+#define LOCK_SH 0x01 /* shared file lock */
+#define LOCK_EX 0x02 /* exclusive file lock */
+#define LOCK_NB 0x04 /* don't block when locking */
+#define LOCK_UN 0x08 /* unlock file */
+
+extern int flock _PARAMS ((int, int));
+
+#endif
+
#endif
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 02fd8e8b9..4abc77e68 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -1,7 +1,7 @@
/* mount.cc: mount handling.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
This file is part of Cygwin.
@@ -1180,6 +1180,7 @@ mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end)
IO_STATUS_BLOCK io;
NTSTATUS status;
HANDLE fh;
+ tmp_pathbuf tp;
if (user)
{
@@ -1204,13 +1205,13 @@ mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end)
return false;
}
- char buf[NT_MAX_PATH];
+ char *buf = tp.c_get ();
char *got = buf;
DWORD len = 0;
unsigned line = 1;
/* Using buffer size - 2 leaves space to append two \0. */
while (NT_SUCCESS (NtReadFile (fh, NULL, NULL, NULL, &io, got,
- (sizeof (buf) - 2) - (got - buf), NULL, NULL)))
+ (NT_MAX_PATH - 2) - (got - buf), NULL, NULL)))
{
char *end;
@@ -1232,7 +1233,7 @@ retry:
got = end + 1;
++line;
}
- if (len < (sizeof (buf) - 2))
+ if (len < (NT_MAX_PATH - 2))
break;
/* Check if the buffer contained at least one \n. If not, the
line length is > 32K. We don't take such long lines. Print
@@ -1241,7 +1242,7 @@ retry:
{
system_printf ("%W: Line %d too long, skipping...", fstab, line);
while (NT_SUCCESS (NtReadFile (fh, NULL, NULL, NULL, &io, buf,
- (sizeof (buf) - 2), NULL, NULL)))
+ (NT_MAX_PATH - 2), NULL, NULL)))
{
len = io.Information;
buf[len] = buf[len + 1] = '\0';
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 54b556a47..480570033 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -1,7 +1,7 @@
/* net.cc: network-related routines.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
This file is part of Cygwin.
@@ -1007,7 +1007,7 @@ cygwin_gethostname (char *name, size_t len)
{
DWORD local_len = len;
- if (!GetComputerNameA (name, &local_len))
+ if (!GetComputerNameExA (ComputerNameDnsFullyQualified, name, &local_len))
{
set_winsock_errno ();
return -1;
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index b1b9e6a49..2f5a45376 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -1,7 +1,7 @@
/* shared.cc: shared data area support.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.
This file is part of Cygwin.
@@ -230,7 +230,7 @@ user_info::initialize ()
spinlock sversion (version, CURR_USER_MAGIC);
if (!sversion)
{
- cb = sizeof (*user_shared);
+ cb = sizeof (*user_shared);
cygpsid sid (cygheap->user.sid ());
struct passwd *pw = internal_getpwsid (sid);
/* Correct the user name with what's defined in /etc/passwd before