]> sourceware.org Git - newlib-cygwin.git/commitdiff
Fix copyright throughout.
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 15 Sep 2004 10:17:53 +0000 (10:17 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 15 Sep 2004 10:17:53 +0000 (10:17 +0000)
Eliminate use of _impure_ptr outside Cygwin.
* bsd_helper.cc: Include errno.h instead of cygerrno.h.
* bsd_mutex.cc : Ditto.
* client.cc: Ditto.
* cygserver.cc: Ditto.
* process.cc: Don't build functions inside Cygwin.  Don't include
cygerrno.h.  Don't set errno.
* transport_pipes.cc (SET_ERRNO): New define.  Use througout.
* transport_sockets.cc (SET_ERRNO): Ditto.
(GET_ERRNO): Ditto.

17 files changed:
winsup/cygserver/ChangeLog
winsup/cygserver/bsd_helper.cc
winsup/cygserver/bsd_log.cc
winsup/cygserver/bsd_mutex.cc
winsup/cygserver/client.cc
winsup/cygserver/cygserver.cc
winsup/cygserver/msg.cc
winsup/cygserver/process.cc
winsup/cygserver/process.h
winsup/cygserver/sem.cc
winsup/cygserver/shm.cc
winsup/cygserver/threaded_queue.h
winsup/cygserver/transport.cc
winsup/cygserver/transport.h
winsup/cygserver/transport_pipes.cc
winsup/cygserver/transport_sockets.cc
winsup/cygserver/transport_sockets.h

index 207983e1b5476a19b9b9fa25b0d4f81e9a771afb..a9781a09c33a3c02eb480b515c03c69b8c39a0dd 100644 (file)
@@ -1,3 +1,17 @@
+2004-09-15  Corinna Vinschen  <corinna@vinschen.de>
+
+       Fix copyright throughout. 
+       Eliminate use of _impure_ptr outside Cygwin.
+       * bsd_helper.cc: Include errno.h instead of cygerrno.h.
+       * bsd_mutex.cc : Ditto.
+       * client.cc: Ditto.
+       * cygserver.cc: Ditto.
+       * process.cc: Don't build functions inside Cygwin.  Don't include
+       cygerrno.h.  Don't set errno.
+       * transport_pipes.cc (SET_ERRNO): New define.  Use througout.
+       * transport_sockets.cc (SET_ERRNO): Ditto.
+       (GET_ERRNO): Ditto.
+
 2004-09-06  Corinna Vinschen  <corinna@vinschen.de>
 
        * bsd_mutex.cc (_msleep): Disable resetting event object for now.
index 14026ce102c4c443df0c2e0565e26290746a7ded..364dddd7f59bdc0cbdc942a18a5b6dfafd883c04 100644 (file)
@@ -1,6 +1,6 @@
 /* bsd_helper.cc
 
-   Copyright 2003 Red Hat Inc.
+   Copyright 2003, 2004 Red Hat Inc.
 
 This file is part of Cygwin.
 
@@ -9,7 +9,7 @@ Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 #ifdef __OUTSIDE_CYGWIN__
 #include "woutsup.h"
-#include "cygerrno.h"
+#include <errno.h>
 #define _KERNEL 1
 #define __BSD_VISIBLE 1
 #include <sys/smallprint.h>
index 5cf1c848ed5262da31c166af4525381832e3ee69..4b0ff74672849c520f6401ffe7b9301f1f4464c0 100644 (file)
@@ -1,6 +1,6 @@
 /* bsd_log.cc
 
-   Copyright 2003 Red Hat Inc.
+   Copyright 2003, 2004 Red Hat Inc.
 
 This file is part of Cygwin.
 
index bd802d0337d2b5b0662f031b8d7a7e24e113afb8..ad3c4a99d9631a3dc718f002551c5fb3b351d3e6 100644 (file)
@@ -1,6 +1,6 @@
 /* bsd_mutex.cc
 
-   Copyright 2003 Red Hat Inc.
+   Copyright 2003, 2004 Red Hat Inc.
 
 This file is part of Cygwin.
 
@@ -9,7 +9,7 @@ Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 #ifdef __OUTSIDE_CYGWIN__
 #include "woutsup.h"
-#include "cygerrno.h"
+#include <errno.h>
 #define _KERNEL 1
 #define __BSD_VISIBLE 1
 #include <sys/smallprint.h>
index 46451a99c95a69725cf165af9df8b87be995590f..953e5a166153c446818f0c2b53d60ce63ab3387d 100644 (file)
@@ -1,6 +1,6 @@
 /* client.cc
 
-   Copyright 2001, 2002, 2003 Red Hat Inc.
+   Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
 
    Written by Egor Duda <deo@logos-m.ru>
 
@@ -18,12 +18,12 @@ details. */
 #endif
 
 #include <assert.h>
+#include <errno.h>
 #include <stdio.h>
 #include <unistd.h>
 
 #include "sigproc.h"
 
-#include "cygerrno.h"
 #include "cygserver_msg.h"
 #include "cygserver_sem.h"
 #include "cygserver_shm.h"
index 0cc6244ad2ca2cdc038d84936152e74875343f19..88f5e67a819fb0ade04a3af8270f7049a675decf 100644 (file)
@@ -1,6 +1,6 @@
 /* cygserver.cc
 
-   Copyright 2001, 2002, 2003 Red Hat Inc.
+   Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
 
    Written by Egor Duda <deo@logos-m.ru>
 
@@ -16,6 +16,7 @@ details. */
 #include <sys/types.h>
 
 #include <assert.h>
+#include <errno.h>
 #include <ctype.h>
 #include <getopt.h>
 #include <signal.h>
@@ -24,7 +25,6 @@ details. */
 #include <string.h>
 #include <unistd.h>
 
-#include "cygerrno.h"
 #include "cygwin_version.h"
 
 #include "cygserver.h"
index fd5eaf5d539c4c64b0cb41fcae81a33687a4ddb7..1e086ed06fa7b344bf8add365285210c4d9adc9c 100644 (file)
@@ -1,6 +1,6 @@
 /* msg.cc: Single unix specification IPC interface for Cygwin.
 
-   Copyright 2003 Red Hat, Inc.
+   Copyright 2003, 2004 Red Hat, Inc.
 
 This file is part of Cygwin.
 
index 8f1ff5776d8ebf7c15a8cda6cd72f7466e824808..94e7893a29a9061ff0889a4845a9d032cb81121f 100644 (file)
@@ -1,6 +1,6 @@
 /* process.cc
 
-   Copyright 2001, 2002 Red Hat Inc.
+   Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
 
    Written by Robert Collins <rbtcollins@hotmail.com>
 
@@ -10,6 +10,7 @@ This software is a copyrighted work licensed under the terms of the
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
+#ifdef __OUTSIDE_CYGWIN__
 #include "woutsup.h"
 
 #include <sys/types.h>
@@ -17,8 +18,6 @@ details. */
 #include <assert.h>
 #include <stdlib.h>
 
-#include "cygerrno.h"
-
 #include "process.h"
 
 /*****************************************************************************/
@@ -250,7 +249,6 @@ process_cache::process (const pid_t cygpid, const DWORD winpid,
                          "new connection refused for %d(%lu)"),
                         MAXIMUM_WAIT_OBJECTS - SPECIALS_COUNT,
                         cygpid, winpid);
-         set_errno (EAGAIN);
          return NULL;
        }
 
@@ -259,7 +257,6 @@ process_cache::process (const pid_t cygpid, const DWORD winpid,
        {
          LeaveCriticalSection (&_cache_write_access);
          delete entry;
-         set_errno (ESRCH);
          return NULL;
        }
 
@@ -433,3 +430,4 @@ process_cache::find (const DWORD winpid, class process **previous)
 }
 
 /*****************************************************************************/
+#endif /* __OUTSIDE_CYGWIN__ */
index 90d7c94b5175b14f487e84b9a6260eac48c82fa3..75d0c72d34fe7c60c8c8710f89a13cce12c27bd8 100644 (file)
@@ -1,6 +1,6 @@
 /* process.h
 
-   Copyright 2001, 2002 Red Hat Inc.
+   Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
 
    Written by Robert Collins <rbtcollins@hotmail.com>
 
index 82ad3ded1ca4579c89c26e897edd57ab90927679..f0fbbac0ba4297aabd6986b8fe50a5111f5b60db 100644 (file)
@@ -1,6 +1,6 @@
 /* sem.cc: Single unix specification IPC interface for Cygwin.
 
-   Copyright 2003 Red Hat, Inc.
+   Copyright 2003, 2004 Red Hat, Inc.
 
 This file is part of Cygwin.
 
index 48aec8a52ee4b856eb19a9516ba6aabcd7bedca9..17b05bfdd46834b22ac125e04eda659809a94b22 100644 (file)
@@ -1,6 +1,6 @@
 /* shm.cc: Single unix specification IPC interface for Cygwin.
 
-   Copyright 2003 Red Hat, Inc.
+   Copyright 2003, 2004 Red Hat, Inc.
 
 This file is part of Cygwin.
 
index 5b6fddc425d2c596a1fd291211aa8a697034bb7c..0c3f9913a811a4b2f5eaae49b7d6c3e1d0912869 100644 (file)
@@ -1,6 +1,6 @@
 /* threaded_queue.h
 
-   Copyright 2001, 2002 Red Hat Inc.
+   Copyright 2001, 2002, 2003 Red Hat Inc.
 
    Written by Robert Collins <rbtcollins@hotmail.com>
 
index a52bb60e7e174323e1797e2f20aff176a83db0e2..0e9708272277ba0612de2e72bf1e20d8da0d7105 100644 (file)
@@ -1,6 +1,6 @@
 /* transport.cc
 
-   Copyright 2001, 2002, 2003 Red Hat Inc.
+   Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
 
    Written by Robert Collins <rbtcollins@hotmail.com>
 
index 76018d20e8eac0b847bac5b4540526455fd6cb15..80f50fd0652286849c6e57069dfc36e1b83073b2 100644 (file)
@@ -1,6 +1,6 @@
 /* transport.h
 
-   Copyright 2001, 2002, 2003 Red Hat Inc.
+   Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
 
    Written by Robert Collins <rbtcollins@hotmail.com>
 
index 5f8ceec4db78786576b0291f21e02954d193f4ca..9fdf75899a71e8864b9db33c2bedd5f5333046f0 100644 (file)
@@ -1,6 +1,6 @@
 /* transport_pipes.cc
 
-   Copyright 2001, 2002, 2003 Red Hat Inc.
+   Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
 
    Written by Robert Collins <rbtcollins@hotmail.com>
 
@@ -35,6 +35,12 @@ details. */
 #include "security.h"
 #endif
 
+#ifdef __INSIDE_CYGWIN__
+#define SET_ERRNO(err) set_errno (err)
+#else
+#define SET_ERRNO(err) errno = (err)
+#endif
+
 enum
   {
     MAX_WAIT_NAMED_PIPE_RETRY = 64,
@@ -214,7 +220,7 @@ transport_layer_pipes::read (void *const buf, const size_t len)
   if (!ReadFile (_hPipe, buf, len, &count, NULL))
     {
       debug_printf ("error reading from pipe (%lu)", GetLastError ());
-      set_errno (EINVAL);      // FIXME?
+      SET_ERRNO (EINVAL);      // FIXME?
       return -1;
     }
 
@@ -234,7 +240,7 @@ transport_layer_pipes::write (void *const buf, const size_t len)
   if (!WriteFile (_hPipe, buf, len, &count, NULL))
     {
       debug_printf ("error writing to pipe, error = %lu", GetLastError ());
-      set_errno (EINVAL);      // FIXME?
+      SET_ERRNO (EINVAL);      // FIXME?
       return -1;
     }
 
index f3668f6d88520d32e97570ef2325339dca72158b..d89e343dcba20d3b97ba3f8fe1cca3fb0864e0a3 100644 (file)
@@ -1,6 +1,6 @@
 /* transport_sockets.cc
 
-   Copyright 2001, 2002 Red Hat Inc.
+   Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
 
    Written by Robert Collins <rbtcollins@hotmail.com>
 
@@ -22,13 +22,21 @@ details. */
 #include <sys/stat.h>
 
 #include <assert.h>
-#include <errno.h>
 #include <stdio.h>
 #include <unistd.h>
 
+#include "cygerrno.h"
 #include "transport.h"
 #include "transport_sockets.h"
 
+#ifdef __INSIDE_CYGWIN__
+#define SET_ERRNO(err) set_errno (err)
+#define GET_ERRNO()    get_errno ()
+#else
+#define SET_ERRNO(err) errno = (err)
+#define GET_ERRNO()    (errno)
+#endif
+
 /* to allow this to link into cygwin and the .dll, a little magic is needed. */
 #ifndef __OUTSIDE_CYGWIN__
 
@@ -99,10 +107,10 @@ transport_layer_sockets::listen ()
 
   if (stat (_addr.sun_path, &sbuf) == -1)
     {
-      if (errno != ENOENT)
+      if (GET_ERRNO () != ENOENT)
        {
          system_printf ("cannot access socket file `%s': %s",
-                        _addr.sun_path, strerror (errno));
+                        _addr.sun_path, strerror (GET_ERRNO ()));
          return -1;
        }
     }
@@ -115,7 +123,7 @@ transport_layer_sockets::listen ()
       if (newfd == -1)
        {
          system_printf ("failed to create UNIX domain socket: %s",
-                        strerror (errno));
+                        strerror (GET_ERRNO ()));
          return -1;
        }
 
@@ -133,7 +141,7 @@ transport_layer_sockets::listen ()
       if (unlink (_addr.sun_path) == -1)
        {
          system_printf ("failed to remove `%s': %s",
-                        _addr.sun_path, strerror (errno));
+                        _addr.sun_path, strerror (GET_ERRNO ()));
          (void) ::close (newfd);
          return -1;
        }
@@ -150,17 +158,17 @@ transport_layer_sockets::listen ()
   if (_fd == -1)
     {
       system_printf ("failed to create UNIX domain socket: %s",
-                    strerror (errno));
+                    strerror (GET_ERRNO ()));
       return -1;
     }
 
   if (cygwin_bind (_fd, (struct sockaddr *) &_addr, _addr_len) == -1)
     {
-      const int saved_errno = errno;
+      const int saved_errno = GET_ERRNO ();
       close ();
-      errno = saved_errno;
+      SET_ERRNO (saved_errno);
       system_printf ("failed to bind UNIX domain socket `%s': %s",
-                    _addr.sun_path, strerror (errno));
+                    _addr.sun_path, strerror (GET_ERRNO ()));
       return -1;
     }
 
@@ -168,11 +176,11 @@ transport_layer_sockets::listen ()
 
   if (cygwin_listen (_fd, SOMAXCONN) == -1)
     {
-      const int saved_errno = errno;
+      const int saved_errno = GET_ERRNO ();
       close ();
-      errno = saved_errno;
+      SET_ERRNO (saved_errno);
       system_printf ("failed to listen on UNIX domain socket `%s': %s",
-                    _addr.sun_path, strerror (errno));
+                    _addr.sun_path, strerror (GET_ERRNO ()));
       return -1;
     }
 
@@ -198,8 +206,8 @@ transport_layer_sockets::accept (bool *const recoverable)
 
   if (accept_fd == -1)
     {
-      system_printf ("failed to accept connection: %s", strerror (errno));
-      switch (errno)
+      system_printf ("failed to accept connection: %s", strerror (GET_ERRNO ()));
+      switch (GET_ERRNO ())
        {
        case ECONNABORTED:
        case EINTR:
@@ -276,7 +284,7 @@ transport_layer_sockets::read (void *const buf, const size_t buf_len)
   if (res != -1)
     {
       if (res == 0)
-       errno = EIO;            // FIXME?
+       SET_ERRNO (EIO);        // FIXME?
 
       res = buf_len - read_buf_len;
     }
@@ -284,7 +292,7 @@ transport_layer_sockets::read (void *const buf, const size_t buf_len)
   if (res != static_cast<ssize_t> (buf_len))
     debug_printf ("%d = read (buf = %p, len = %u) [this = %p, fd = %d]: %s",
                  res, buf, buf_len, this, _fd,
-                 (res == -1 ? strerror (errno) : "EOF"));
+                 (res == -1 ? strerror (GET_ERRNO ()) : "EOF"));
   else
     {
       // verbose: debug_printf ("%d = read (buf = %p, len = %u) [this = %p, fd = %d]",
@@ -322,7 +330,7 @@ transport_layer_sockets::write (void *const buf, const size_t buf_len)
   if (res != -1)
     {
       if (res == 0)
-       errno = EIO;            // FIXME?
+       SET_ERRNO (EIO);        // FIXME?
 
       res = buf_len - write_buf_len;
     }
@@ -330,7 +338,7 @@ transport_layer_sockets::write (void *const buf, const size_t buf_len)
   if (res != static_cast<ssize_t> (buf_len))
     debug_printf ("%d = write (buf = %p, len = %u) [this = %p, fd = %d]: %s",
                  res, buf, buf_len, this, _fd,
-                 (res == -1 ? strerror (errno) : "EOF"));
+                 (res == -1 ? strerror (GET_ERRNO ()) : "EOF"));
   else
     {
       // verbose: debug_printf ("%d = write (buf = %p, len = %u) [this = %p, fd = %d]",
@@ -358,7 +366,7 @@ transport_layer_sockets::connect ()
       if (_fd == -1)
        {
          system_printf ("failed to create UNIX domain socket: %s",
-                        strerror (errno));
+                        strerror (GET_ERRNO ()));
          return -1;
        }
 
@@ -369,9 +377,9 @@ transport_layer_sockets::connect ()
          return 0;
        }
 
-      if (!assume_cygserver || errno != ECONNREFUSED)
+      if (!assume_cygserver || GET_ERRNO () != ECONNREFUSED)
        {
-         debug_printf ("failed to connect to server: %s", strerror (errno));
+         debug_printf ("failed to connect to server: %s", strerror (GET_ERRNO ()));
          (void) ::close (_fd);
          _fd = -1;
          return -1;
@@ -382,6 +390,6 @@ transport_layer_sockets::connect ()
       Sleep (0);               // Give the server a chance.
     }
 
-  debug_printf ("failed to connect to server: %s", strerror (errno));
+  debug_printf ("failed to connect to server: %s", strerror (GET_ERRNO ()));
   return -1;
 }
index d684a87c9d5bd680f74152d9271dadcc6c8744ef..dab086e7d92ea2250e3df7c90c967feb78d426e8 100644 (file)
@@ -1,6 +1,6 @@
 /* transport_sockets.h
 
-   Copyright 2001, 2002 Red Hat Inc.
+   Copyright 2001, 2002, 2003 Red Hat Inc.
 
    Written by Robert Collins <rbtcollins@hotmail.com>
 
This page took 0.049948 seconds and 5 git commands to generate.