diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e95c42ee2..974d56e84 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2012-02-28 Eric Blake + + * include/sys/termios.h (tcgetsid): Fix return type. + * termios.cc (tcgetsid): Likewise. + * fhandler_termios.cc (fhandler_termios::tcgetsid): Likewise. + * fhandler.h (fhandler_base): Likewise. + * fhandler.cc (fhandler_base::tcgetsid): Likewise. + 2012-02-28 Corinna Vinschen * cygtls.cc (well_known_dlls): Add shlwapi.dll. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index ef25a07b8..c3bca4f7d 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1464,7 +1464,7 @@ fhandler_base::tcgetpgrp () return -1; } -int +pid_t fhandler_base::tcgetsid () { set_errno (ENOTTY); diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 605f59b61..3b186bd8b 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -383,7 +383,7 @@ public: virtual int tcgetattr (struct termios *t); virtual int tcsetpgrp (const pid_t pid); virtual int tcgetpgrp (); - virtual int tcgetsid (); + virtual pid_t tcgetsid (); virtual bool is_tty () const { return false; } virtual bool ispipe () const { return false; } virtual pid_t get_popen_pid () const {return 0;} @@ -1155,7 +1155,7 @@ class fhandler_termios: public fhandler_base virtual void __release_output_mutex (const char *fn, int ln) {} void echo_erase (int force = 0); virtual _off64_t lseek (_off64_t, int); - int tcgetsid (); + pid_t tcgetsid (); fhandler_termios (void *) {} diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index c218fdeda..36017dc63 100644 --- a/winsup/cygwin/fhandler_termios.cc +++ b/winsup/cygwin/fhandler_termios.cc @@ -1,7 +1,7 @@ /* fhandler_termios.cc Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009, - 2010, 2011 Red Hat, Inc. + 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -401,7 +401,7 @@ fhandler_termios::sigflush () tcflush (TCIFLUSH); } -int +pid_t fhandler_termios::tcgetsid () { if (myself->ctty != -1 && myself->ctty == tc ()->ntty) diff --git a/winsup/cygwin/include/sys/termios.h b/winsup/cygwin/include/sys/termios.h index a0d1b2445..a87f9de68 100644 --- a/winsup/cygwin/include/sys/termios.h +++ b/winsup/cygwin/include/sys/termios.h @@ -1,7 +1,7 @@ /* sys/termios.h Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, - 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -14,6 +14,8 @@ details. */ #ifndef _SYS_TERMIOS_H #define _SYS_TERMIOS_H +#include + #define TIOCMGET 0x5415 #define TIOCMBIS 0x5416 #define TIOCMBIC 0x5417 @@ -328,7 +330,7 @@ int tcsendbreak (int, int); int tcdrain (int); int tcflush (int, int); int tcflow (int, int); -int tcgetsid (int); +pid_t tcgetsid (int); void cfmakeraw (struct termios *); speed_t cfgetispeed(const struct termios *); speed_t cfgetospeed(const struct termios *); diff --git a/winsup/cygwin/termios.cc b/winsup/cygwin/termios.cc index 309651304..0fb0de2ad 100644 --- a/winsup/cygwin/termios.cc +++ b/winsup/cygwin/termios.cc @@ -1,7 +1,7 @@ /* termios.cc: termios for WIN32. Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. Written by Doug Evans and Steve Chamberlain of Cygnus Support dje@cygnus.com, sac@cygnus.com @@ -207,7 +207,7 @@ tcgetpgrp (int fd) return res; } -extern "C" int +extern "C" pid_t tcgetsid (int fd) { int res;