aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygserver/transport_pipes.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-09-15 10:17:53 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-09-15 10:17:53 +0000
commit1dcd520bb878cfd02e72f31b9e2d8ccdd3073a2c (patch)
tree94b87d56b4ff157a24e01fd570a906987f1ba51c /winsup/cygserver/transport_pipes.cc
parentb103e0d73285adeb8dc4dfa58568dacf2927742e (diff)
downloadnewlib-1dcd520bb878cfd02e72f31b9e2d8ccdd3073a2c.zip
newlib-1dcd520bb878cfd02e72f31b9e2d8ccdd3073a2c.tar.gz
newlib-1dcd520bb878cfd02e72f31b9e2d8ccdd3073a2c.tar.bz2
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.
Diffstat (limited to 'winsup/cygserver/transport_pipes.cc')
-rw-r--r--winsup/cygserver/transport_pipes.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygserver/transport_pipes.cc b/winsup/cygserver/transport_pipes.cc
index 5f8ceec..9fdf758 100644
--- a/winsup/cygserver/transport_pipes.cc
+++ b/winsup/cygserver/transport_pipes.cc
@@ -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;
}