[newlib-cygwin] Use remove-advertising-clause script to edit BSD licenses

2020-01-29 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9042d0ce65533a26fc3264206db5828d5692332c

commit 9042d0ce65533a26fc3264206db5828d5692332c
Author: Keith Packard 
Date:   Tue Jan 28 10:54:53 2020 -0800

Use remove-advertising-clause script to edit BSD licenses

This edits licenses held by Berkeley and NetBSD, both of which
have removed the advertising requirement from their licenses.

Signed-off-by: Keith Packard 

Diff:
---
 libgloss/i386/cygmon-gmon.c  | 6 +-
 libgloss/m32r/Makefile.in| 2 +-
 libgloss/nds32/Makefile.in   | 2 +-
 libgloss/sparc/libsys/Makefile.in| 2 +-
 libgloss/sparc/libsys/configure.in   | 2 +-
 libgloss/sparc_leon/asm-leon/leonbare_kernel_queue.h | 6 +-
 libgloss/sparc_leon/asm-leon/queue.h | 6 +-
 mkdep| 2 +-
 newlib/libc/ctype/ctype_.c   | 6 +-
 newlib/libc/include/ar.h | 6 +-
 newlib/libc/include/grp.h| 6 +-
 newlib/libc/include/pwd.h| 6 +-
 newlib/libc/include/stdio.h  | 2 +-
 newlib/libc/include/sys/syslimits.h  | 6 +-
 newlib/libc/include/unctrl.h | 6 +-
 newlib/libc/machine/hppa/DEFS.h  | 2 +-
 newlib/libc/machine/powerpc/vfprintf.c   | 6 +-
 newlib/libc/machine/powerpc/vfscanf.c| 2 +-
 newlib/libc/machine/sparc/setjmp.S   | 6 +-
 newlib/libc/misc/unctrl.c| 6 +-
 newlib/libc/posix/cclass.h   | 6 +-
 newlib/libc/posix/closedir.c | 6 +-
 newlib/libc/posix/cname.h| 6 +-
 newlib/libc/posix/fnmatch.3  | 6 +-
 newlib/libc/posix/glob.3 | 6 +-
 newlib/libc/posix/opendir.c  | 6 +-
 newlib/libc/posix/readdir.c  | 6 +-
 newlib/libc/posix/readdir_r.c| 6 +-
 newlib/libc/posix/regex.3| 6 +-
 newlib/libc/posix/regex2.h   | 6 +-
 newlib/libc/posix/rewinddir.c| 6 +-
 newlib/libc/posix/seekdir.c  | 6 +-
 newlib/libc/posix/telldir.c  | 6 +-
 newlib/libc/posix/utils.h| 6 +-
 newlib/libc/search/db_local.h| 6 +-
 newlib/libc/search/extern.h  | 6 +-
 newlib/libc/search/hash.c| 6 +-
 newlib/libc/search/hash.h| 6 +-
 newlib/libc/search/hash_bigkey.c | 6 +-
 newlib/libc/search/hash_buf.c| 6 +-
 newlib/libc/search/hash_func.c   | 6 +-
 newlib/libc/search/hash_log2.c   | 6 +-
 newlib/libc/search/hash_page.c   | 6 +-
 newlib/libc/search/page.h| 6 +-
 newlib/libc/stdio/asiprintf.c| 2 +-
 newlib/libc/stdio/asprintf.c | 2 +-
 newlib/libc/stdio/clearerr.c | 2 +-
 newlib/libc/stdio/fclose.c   | 2 +-
 newlib/libc/stdio/fcloseall.c| 2 +-
 newlib/libc/stdio/fdopen.c   | 2 +-
 newlib/libc/stdio/feof.c | 2 +-
 newlib/libc/stdio/ferror.c   | 2 +-
 newlib/libc/stdio/fflush.c   | 2 +-
 newlib/libc/stdio/fgetc.c| 2 +-
 newlib/libc/stdio/fgetpos.c  | 2 +-
 newlib/libc/stdio/fgets.c| 2 +-
 newlib/libc/stdio/fileno.c   | 2 +-
 newlib/libc/stdio/findfp.c   | 2 +-
 newlib/libc/stdio/fiprintf.c | 2 +-
 newlib/libc/stdio/fiscanf.c  | 2 +-
 newlib/libc/stdio/flags.c| 2 +-
 newlib/libc/stdio/floatio.h  | 2 +-
 newlib/libc/stdio/fopen.c| 2 +-
 newlib/libc/stdio/fprintf.c  | 2 +-
 newlib/libc/stdio/fputc.c| 2 +-
 newlib/libc/stdio/fputs.c| 2 +-
 newlib/libc/stdio/fread.c| 2 +-
 newlib/libc/stdio/freopen.c  | 2 +-
 newlib/libc/stdio/fscanf.c   | 2 +-
 newlib/libc/stdio/fseek.c| 2 +-
 newlib/libc/stdio/fseeko.c   | 2 +-
 newlib/libc/stdio/fsetpos.c  | 2 +-

[newlib-cygwin] Cygwin: stat: fix st_mode of fifos

2020-01-29 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f36262d56ac78f04de147746ce4a85c6155e4a23

commit f36262d56ac78f04de147746ce4a85c6155e4a23
Author: Corinna Vinschen 
Date:   Wed Jan 29 15:14:05 2020 +0100

Cygwin: stat: fix st_mode of fifos

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/fhandler_disk_file.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_disk_file.cc 
b/winsup/cygwin/fhandler_disk_file.cc
index be45ad7..f362e31 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -480,7 +480,7 @@ fhandler_base::fstat_helper (struct stat *buf)
 {
   /* If read-only attribute is set, modify ntsec return value */
   if (::has_attribute (attributes, FILE_ATTRIBUTE_READONLY)
- && !pc.isdir () && !pc.issymlink ())
+ && !pc.isdir () && !pc.issymlink () && !pc.is_fs_special ())
buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
 
   if (buf->st_mode & S_IFMT)
@@ -490,7 +490,7 @@ fhandler_base::fstat_helper (struct stat *buf)
   else
{
  buf->st_dev = buf->st_rdev = dev ();
- buf->st_mode = dev ().mode ();
+ buf->st_mode |= dev ().mode () & S_IFMT;
  buf->st_size = 0;
}
 }


[newlib-cygwin] Cygwin: remove CYGWIN=dos_file_warning option

2020-01-29 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=13bfb3c63f35d875c1771daea6de4be0176e3b13

commit 13bfb3c63f35d875c1771daea6de4be0176e3b13
Author: Corinna Vinschen 
Date:   Tue Jan 28 21:59:22 2020 +0100

Cygwin: remove CYGWIN=dos_file_warning option

This option has been disabled long ago and nobody missed it.
Removing drops a bit of unneeded code

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/environ.cc|  1 -
 winsup/cygwin/external.cc   |  5 +
 winsup/cygwin/fhandler_disk_file.cc |  2 +-
 winsup/cygwin/globals.cc|  1 -
 winsup/cygwin/path.cc   | 36 
 winsup/cygwin/path.h|  1 -
 winsup/cygwin/pinfo.cc  |  4 ++--
 winsup/cygwin/quotactl.cc   |  2 +-
 winsup/doc/cygwinenv.xml| 11 +--
 9 files changed, 14 insertions(+), 49 deletions(-)

diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 7eb4780..3a03657 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -111,7 +111,6 @@ static struct parse_thing
   } values[2];
   } known[] NO_COPY =
 {
-  {"dosfilewarning", {&dos_file_warning}, setbool, NULL, {{false}, {true}}},
   {"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
   {"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
   {"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index 94431bb..14a1dfb 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -452,10 +452,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
res = CYGTLS_PADSIZE;
break;
   case CW_SET_DOS_FILE_WARNING:
-   {
- dos_file_warning = va_arg (arg, int);
- res = 0;
-   }
+   res = 0;
break;
   case CW_SET_PRIV_KEY:
{
diff --git a/winsup/cygwin/fhandler_disk_file.cc 
b/winsup/cygwin/fhandler_disk_file.cc
index 19a1c5a..be45ad7 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -2062,7 +2062,7 @@ readdir_get_ino (const char *path, bool dot_dot)
   strcpy (c, "..");
   path = fname;
 }
-  path_conv pc (path, PC_SYM_NOFOLLOW | PC_POSIX | PC_NOWARN | PC_KEEP_HANDLE);
+  path_conv pc (path, PC_SYM_NOFOLLOW | PC_POSIX | PC_KEEP_HANDLE);
   if (pc.isspecial ())
 {
   if (!stat_worker (pc, &st))
diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc
index a9648fe..942bd1c 100644
--- a/winsup/cygwin/globals.cc
+++ b/winsup/cygwin/globals.cc
@@ -65,7 +65,6 @@ int NO_COPY dynamically_loaded;
 
 /* Some CYGWIN environment variable variables. */
 bool allow_glob = true;
-bool dos_file_warning;
 bool ignore_case_with_glob;
 bool pipe_byte;
 bool reset_com;
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 142a739..4da8884 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -532,31 +532,6 @@ path_conv::get_wide_win32_path (PWCHAR wc)
   return wc;
 }
 
-static void
-warn_msdos (const char *src)
-{
-  if (user_shared->warned_msdos || !cygwin_finished_initializing)
-return;
-  tmp_pathbuf tp;
-  char *posix_path = tp.c_get ();
-  small_printf ("Cygwin WARNING:\n");
-  if (cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_RELATIVE, src,
-   posix_path, NT_MAX_PATH))
-small_printf (
-"  MS-DOS style path detected: %ls\n  POSIX equivalent preferred.\n",
- src);
-  else
-small_printf (
-"  MS-DOS style path detected: %ls\n"
-"  Preferred POSIX equivalent is: %ls\n",
- src, posix_path);
-  small_printf (
-"  CYGWIN environment variable option \"nodosfilewarning\" turns off this\n"
-"  warning.  Consult the user's guide for more details about POSIX paths:\n"
-"  http://cygwin.com/cygwin-ug-net/using.html#using-pathnames\n";);
-  user_shared->warned_msdos = true;
-}
-
 static DWORD
 getfileattr (const char *path, bool caseinsensitive) /* path has to be always 
absolute. */
 {
@@ -1253,8 +1228,6 @@ path_conv::check (const char *src, unsigned opt,
  if (tail < path_end && tail > path_copy + 1)
*tail = '/';
  set_posix (path_copy);
- if (is_msdos && dos_file_warning && !(opt & PC_NOWARN))
-   warn_msdos (src);
}
 
 #if 0
@@ -1916,8 +1889,7 @@ symlink_worker (const char *oldpath, path_conv 
&win32_newpath, bool isdevice)
{
  char *newplnk = tp.c_get ();
  stpcpy (stpcpy (newplnk, win32_newpath.get_posix ()), ".lnk");
- win32_newpath.check (newplnk, PC_SYM_NOFOLLOW | PC_POSIX
-   | (isdevice ? PC_NOWARN : 0));
+ win32_newpath.check (newplnk, PC_SYM_NOFOLLOW | PC_POSIX);
}
 
   if (win32_newpath.error)
@@ -3492,7 +3464,7 @@ cygwin_conv_path (cygwin_conv_path_t what, const void 
*from, void *to,
  {
p.check ((const char *) from,