This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MSYS mode (continue)


2013-06-18  Alexey Pavlov

* mount.cc: Allow using a shortened version of mount points in /etc/fstab
* utsname.h: Increase sysname fiels size.
* uname.cc: Allow changing OS name by MSYSTEM environment variable.

Index: cygwin/mount.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/mount.cc,v
retrieving revision 1.100
diff -u -p -r1.100 mount.cc
--- cygwin/mount.cc 24 Apr 2013 10:16:12 -0000 1.100
+++ cygwin/mount.cc 18 Jun 2013 11:39:27 -0000
@@ -1125,8 +1125,16 @@ mount_info::from_fstab_line (char *line,
   if (!*c)
     return true;
   cend = find_ws (c);
-  *cend = '\0';
   posix_path = conv_fstab_spaces (c);
+  if (!*cend)
+   {
+     unsigned mount_flags = MOUNT_SYSTEM | MOUNT_BINARY |
MOUNT_NOPOSIX | MOUNT_NOACL;
+     int res = mount_table->add_item (native_path, posix_path, mount_flags);
+     if (res && get_errno () == EMFILE)
+       return false;
+     return true;
+   }
+  *cend = '\0';
   /* Third field: FS type. */
   c = skip_ws (cend + 1);
   if (!*c)
Index: cygwin/uname.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/uname.cc,v
retrieving revision 1.31
diff -u -p -r1.31 uname.cc
--- cygwin/uname.cc 21 Jan 2013 04:38:29 -0000 1.31
+++ cygwin/uname.cc 18 Jun 2013 11:39:27 -0000
@@ -29,7 +29,9 @@ uname (struct utsname *name)
   char *snp = strstr  (cygwin_version.dll_build_date, "SNP");

   memset (name, 0, sizeof (*name));
-  __small_sprintf (name->sysname, "CYGWIN_%s", wincap.osname ());
+  char* msystem = getenv("MSYSTEM");
+  const char *msystem_cyg = "CYGWIN";
+  __small_sprintf (name->sysname, "%s_%s", msystem ? msystem :
msystem_cyg, wincap.osname ());

 #if 0
   /* Recognition of the real 64 bit CPU inside of a WOW64 system, irritates
Index: cygwin/include/sys/utsname.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/sys/utsname.h,v
retrieving revision 1.3
diff -u -p -r1.3 utsname.h
--- cygwin/include/sys/utsname.h 21 Jan 2013 04:38:31 -0000 1.3
+++ cygwin/include/sys/utsname.h 18 Jun 2013 11:39:27 -0000
@@ -17,7 +17,7 @@ extern "C" {

 struct utsname
 {
-  char sysname[20];
+  char sysname[21];
   char nodename[20];
   char release[20];
   char version[20];

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]