]> sourceware.org Git - newlib-cygwin.git/commitdiff
* include/cygwin/version.h: Bump API to reflect setlogmask.
authorChristopher Faylor <me@cgf.cx>
Mon, 22 Jan 2001 20:29:24 +0000 (20:29 +0000)
committerChristopher Faylor <me@cgf.cx>
Mon, 22 Jan 2001 20:29:24 +0000 (20:29 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/include/cygwin/version.h
winsup/cygwin/path.cc
winsup/cygwin/path.h
winsup/cygwin/syscalls.cc

index 328a575dd948b5b2bda599cc228ac1917264820a..91f63fa9d0ff738f6f97c903db9c8a2811a7ade4 100644 (file)
@@ -1,3 +1,7 @@
+Mon Jan 22 15:27:12 2001  Christopher Faylor <cgf@cygnus.com>
+
+       * include/cygwin/version.h: Bump API to reflect setlogmask.
+
 Sun Jan 21 22:40:25 2001  Jason Tishler <jt@dothill.com>
 
        * cygwin.din: Add export for setlogmask().
index a8ce9894c212676041a2d002102255d6f06f6cdc..a9de98d7aa93774b53f43ee49cd23e4a33abcced 100644 (file)
@@ -123,10 +123,11 @@ details. */
        30: CW_GET_CYGDRIVE_INFO addition to external.cc
        31: Export inet_aton
        32: Export getrlimit/setrlimit
+       33: Export setlogmask
      */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 32
+#define CYGWIN_VERSION_API_MINOR 33
 
      /* There is also a compatibity version number associated with the
        shared memory regions.  It is incremented when incompatible
index d86f19464fe418bddff4ee011f8e87129d687e56..de13b05728f4b334ca6de451a962cc354c1e4bb6 100644 (file)
@@ -298,6 +298,7 @@ path_conv::check (const char *src, unsigned opt,
             these operations again on the newly derived path. */
          else if (len > 0)
            {
+             set_has_symlinks ();
              if (component == 0 && !need_directory && !(opt & PC_SYM_FOLLOW))
                {
                  set_symlink (); // last component of path is a symlink.
@@ -315,7 +316,7 @@ path_conv::check (const char *src, unsigned opt,
              (tail > path_copy && tail[-1] == ':'))
            goto out;   // all done
 
-         /* Haven't found a valid pathname component yet.
+         /* Haven't found an existing pathname component yet.
             Pinch off the tail and try again. */
          *tail = '\0';
          component++;
@@ -2372,10 +2373,7 @@ symlink_info::check (const char *in_path, const suffix_info *suffixes)
              /* Not a symlink, see if executable.  */
              if (!(pflags & PATH_ALL_EXEC) &&
                  has_exec_chars (cookie_buf, got))
-{
-debug_printf ("setting exec flag");
                pflags |= PATH_EXEC;
-}
            close_and_return:
              CloseHandle (h);
              goto file_not_symlink;
@@ -2572,10 +2570,41 @@ chdir (const char *dir)
       native_dir[3] = '\0';
     }
   int res = SetCurrentDirectoryA (native_dir) ? 0 : -1;
+
   if (res == -1)
     __seterrno ();
+  else if (!path.has_symlinks ())
+    cygcwd.set (path, dir);
   else
-    cygcwd.set (path, strpbrk (dir, ":\\") != NULL ? NULL : dir);
+    {
+      char curcwd[MAX_PATH];
+      char fulldir[MAX_PATH];
+      char *p;
+      char **tail[MAX_PATH / 2];
+      int len = strlen (dir) + 1;
+
+      if (isabspath (dir))
+       p = fulldir;
+      else
+       {
+         p = strchr (strcpy (fulldir, cygcwd.get (curcwd)), '\0');
+         if (p > fulldir + 1)
+           strcpy (p++, "/");
+        }
+      strcpy (p, dir);
+      dir = fulldir;
+      for (;;)
+       {
+         path_conv resolved (dir, PC_SYM_NOFOLLOW | PC_FULL);
+         if (resolved.get_attributes () & FILE_ATTRIBUTE_DIRECTORY)
+           {
+             cygcwd.set (path, dir);
+             break;
+           }
+         char *p = strrchr (dir)
+         tail[i] = 
+       }
+    }
 
   /* Note that we're accessing cwd.posix without a lock here.  I didn't think
      it was worth locking just for strace. */
index ca039e200e69867eeaf7d931785e1c1ade1664b1..6d0a195e39c8bdf5036e2b0cc0c80e725e212a6d 100644 (file)
@@ -37,6 +37,7 @@ enum path_types
   PATH_EXEC = MOUNT_EXEC,
   PATH_CYGWIN_EXEC = MOUNT_CYGWIN_EXEC,
   PATH_ALL_EXEC = PATH_CYGWIN_EXEC | PATH_EXEC,
+  PATH_HAS_SYMLINKS = 0x10000000,
   PATH_HASBUGGYOPEN = 0x20000000,
   PATH_SOCKET =       0x40000000,
   PATH_HASACLS =      0x80000000
@@ -50,6 +51,7 @@ class path_conv
   unsigned path_flags;
 
   int has_acls () {return path_flags & PATH_HASACLS;}
+  int has_symlinks () {return path_flags & PATH_HAS_SYMLINKS;}
   int hasgood_inode () {return path_flags & PATH_HASACLS;}  // Not strictly correct
   int has_buggy_open () {return path_flags & PATH_HASBUGGYOPEN;}
   int isbinary () {return path_flags & PATH_BINARY;}
@@ -60,6 +62,7 @@ class path_conv
 
   void set_binary () {path_flags |= PATH_BINARY;}
   void set_symlink () {path_flags |= PATH_SYMLINK;}
+  void set_has_symlinks () {path_flags |= PATH_HAS_SYMLINKS;}
   void set_exec (int x = 1) {path_flags |= x ? PATH_EXEC : PATH_NOTHING;}
   void set_has_acls (int x = 1) {path_flags |= x ? PATH_HASACLS : PATH_NOTHING;}
   void set_has_buggy_open (int x = 1) {path_flags |= x ? PATH_HASBUGGYOPEN : PATH_NOTHING;}
index b7b2f5cb93c77cb5e95c2a555fc82b4f56faffd1..f42c9e126e103b9c12786956738814225ff56584 100644 (file)
@@ -245,10 +245,7 @@ beg:
       if (!wait)
        set_sig_errno (EAGAIN); /* Don't really need 'set_sig_errno' here, but... */
       else
-       {
-         set_sig_errno (EINTR);
-         sawsig = 1;
-       }
+       set_sig_errno (EINTR);
       res = -1;
       goto out;
     }
@@ -264,7 +261,7 @@ beg:
     }
 
 out:
-  if (sawsig && call_signal_handler ())
+  if (res < 0 && get_errno () == EINTR && call_signal_handler ())
     goto beg;
   syscall_printf ("%d = read (%d<%s>, %p, %d), bin %d, errno %d", res, fd, fh->get_name (),
                  ptr, len, fh->get_r_binary (), get_errno ());
This page took 0.039542 seconds and 5 git commands to generate.