From 0e1f0840d2def205a7e2089872038930643d48f7 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 11 Jan 2012 19:07:11 +0000 Subject: [PATCH] Update copyright on all files checked in so far this year. * fhandler.h: Use #pragma once rather than ifdef guards. (fhandler_console::tc_getpgid): Return our pgid if we have never opened a console. * fork.cc: Rearrange includes to accommodate fhandler.h use of pinfo.h. * sigproc.cc: Ditto. * spawn.cc: Ditto. (child_info_spawn::worker): Query myself->pgid rather than calling expensive function. * thread.h: Use #pragma once rather than ifdef guards. * pinfo.h: Use #pragma once rather than ifdef guards. (pinfo::remember): Don't define if sigproc.h has not been included. (pinfo::reattach): Ditto. * sigproc.h: Use #pragma once rather than ifdef guards. Use different test to see if pinfo.h has been included. --- winsup/cygwin/ChangeLog | 24 +++++++++++++++++++++--- winsup/cygwin/dtable.cc | 2 +- winsup/cygwin/fhandler.h | 12 +++++++----- winsup/cygwin/fork.cc | 4 ++-- winsup/cygwin/include/cygwin/version.h | 2 +- winsup/cygwin/path.cc | 2 +- winsup/cygwin/pinfo.cc | 2 +- winsup/cygwin/pinfo.h | 13 ++++++------- winsup/cygwin/sigproc.cc | 5 ++--- winsup/cygwin/sigproc.h | 8 +++----- winsup/cygwin/spawn.cc | 10 ++++++---- winsup/cygwin/thread.cc | 2 +- winsup/cygwin/thread.h | 6 ++---- 13 files changed, 54 insertions(+), 38 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4fec5fdbd..bc796f681 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,21 @@ +2012-01-11 Christopher Faylor + + Update copyright on all files checked in so far this year. + * fhandler.h: Use #pragma once rather than ifdef guards. + (fhandler_console::tc_getpgid): Return our pgid if we have never opened + a console. + * fork.cc: Rearrange includes to accommodate fhandler.h use of pinfo.h. + * sigproc.cc: Ditto. + * spawn.cc: Ditto. + (child_info_spawn::worker): Query myself->pgid rather than calling + expensive function. + * thread.h: Use #pragma once rather than ifdef guards. + * pinfo.h: Use #pragma once rather than ifdef guards. + (pinfo::remember): Don't define if sigproc.h has not been included. + (pinfo::reattach): Ditto. + * sigproc.h: Use #pragma once rather than ifdef guards. Use different + test to see if pinfo.h has been included. + 2012-01-09 Corinna Vinschen * include/cygwin/process.h: Move here from newlib. @@ -11,7 +29,7 @@ * miscfuncs.cc (thread_wrapper): Make sure stack is 16 byte aligned to make gcc-3 compiled pthread applications happy. -2012-01-08 Christopher Faylor +2012-01-08 Christopher Faylor * dtable.cc (dtable::stdio_init): Always initialize console when we have one. @@ -29,10 +47,10 @@ * cygwin.din (pthread_sigqueue): Export. * posix.sgml (std-gnu): Add pthread_sigqueue. * thread.cc (pthread_sigqueue): New function. - * include/thread.h (pthread_sigqueue): New function. + * thread.h (pthread_sigqueue): New function. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. -2012-01-02 Christopher Faylor +2012-01-02 Christopher Faylor * path.cc (get_current_dir_name): Avoid memory leak. Don't return PWD contents if directory doesn't actually exist. diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 361010e11..a47a77d98 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -1,7 +1,7 @@ /* dtable.cc: file descriptor support. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 0a73af82f..e4ba58423 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1,7 +1,7 @@ /* fhandler.h Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -9,8 +9,8 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#ifndef _FHANDLER_H_ -#define _FHANDLER_H_ +#pragma once +#include "pinfo.h" #include "tty.h" /* fcntl flags used only internaly. */ @@ -1307,7 +1307,10 @@ private: static console_state *open_shared_console (HWND, HANDLE&, bool&); public: - static pid_t tc_getpgid () {return shared_console_info->tty_min_state.getpgid ();} + static pid_t tc_getpgid () + { + return shared_console_info ? shared_console_info->tty_min_state.getpgid () : myself->pgid; + } fhandler_console (fh_devices); static console_state *open_shared_console (HWND hw, HANDLE& h) { @@ -2113,4 +2116,3 @@ typedef union char __virtual[sizeof (fhandler_virtual)]; char __windows[sizeof (fhandler_windows)]; } fhandler_union; -#endif /* _FHANDLER_H_ */ diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index b1347b8df..313e0da59 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -14,11 +14,11 @@ details. */ #include #include #include "cygerrno.h" +#include "sigproc.h" +#include "pinfo.h" #include "path.h" #include "fhandler.h" #include "dtable.h" -#include "sigproc.h" -#include "pinfo.h" #include "cygheap.h" #include "child_info.h" #include "cygtls.h" diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 7b4b2071f..d6878cd65 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -1,7 +1,7 @@ /* version.h -- Cygwin version numbers and accompanying documentation. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index bbc93afbc..fdef934b8 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1,7 +1,7 @@ /* path.cc: path support. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 65640b2c9..1de363f7d 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -1,7 +1,7 @@ /* pinfo.cc: process table support Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h index 8a6e682d8..62ddcb79e 100644 --- a/winsup/cygwin/pinfo.h +++ b/winsup/cygwin/pinfo.h @@ -1,7 +1,7 @@ /* pinfo.h: process table info Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - 2011 Red Hat, Inc. + 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -9,8 +9,8 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#ifndef _PINFO_H -#define _PINFO_H +#pragma once + #include #include "thread.h" @@ -187,9 +187,9 @@ public: operator _pinfo * () const {return procinfo;} void preserve () { destroy = false; } void allow_remove () { destroy = true; } -#ifndef _SIGPROC_H - int reattach () {system_printf ("reattach is not here"); return 0;} - int remember () {system_printf ("remember is not here"); return 0;} +#ifndef SIG_BAD_MASK // kludge to ensure that sigproc.h included + // int reattach () {system_printf ("reattach is not here"); return 0;} + // int remember (bool) {system_printf ("remember is not here"); return 0;} #else int reattach () { @@ -291,4 +291,3 @@ int __stdcall fixup_shms_after_fork (); void __stdcall fill_rusage (struct rusage *, HANDLE); void __stdcall add_rusage (struct rusage *, struct rusage *); -#endif /*_PINFO_H*/ diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index a8c45f707..01278ef80 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -1,7 +1,7 @@ /* sigproc.cc: inter/intra signal and sub process handler Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -14,15 +14,14 @@ details. */ #include #include #include "cygerrno.h" +#include "sigproc.h" #include "path.h" #include "fhandler.h" #include "dtable.h" -#include "sigproc.h" #include "cygheap.h" #include "child_info_magic.h" #include "shared_info.h" #include "cygtls.h" -#include "pinfo.h" #include "ntdll.h" /* diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index a9678376e..2900da4cc 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -1,7 +1,7 @@ /* sigproc.h Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2011 Red Hat, Inc. + 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -9,8 +9,7 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#ifndef _SIGPROC_H -#define _SIGPROC_H +#pragma once #include #ifdef NSIG @@ -62,7 +61,7 @@ extern HANDLE signal_arrived; extern HANDLE sigCONT; void __stdcall sig_dispatch_pending (bool fast = false); -#ifdef _PINFO_H +#ifdef EXITCODE_SET extern "C" void __stdcall set_signal_mask (sigset_t newmask, sigset_t&); #endif int __stdcall handle_sigprocmask (int sig, const sigset_t *set, @@ -123,4 +122,3 @@ extern char myself_nowait_dummy[]; extern struct sigaction *global_sigs; #define myself_nowait ((_pinfo *) myself_nowait_dummy) -#endif /*_SIGPROC_H*/ diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 74642519a..c0320fc08 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -18,16 +18,16 @@ details. */ #include #include #include -#include "cygerrno.h" #include +#include "cygerrno.h" #include "security.h" +#include "sigproc.h" +#include "pinfo.h" #include "path.h" #include "fhandler.h" #include "dtable.h" -#include "sigproc.h" #include "cygheap.h" #include "child_info.h" -#include "pinfo.h" #include "environ.h" #include "cygtls.h" #include "tls_pbuf.h" @@ -337,6 +337,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, int looped = 0; HANDLE orig_wr_proc_pipe = NULL; +#if 0 myfault efault; if (efault.faulted ()) { @@ -347,6 +348,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, res = -1; goto out; } +#endif child_info_types chtype; if (mode != _P_OVERLAY) @@ -584,7 +586,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, because the Ctrl-C event is sent to all processes in the console, unless they ignore it explicitely. CREATE_NEW_PROCESS_GROUP does that for us. */ if (!iscygwin () && myself->ctty >= 0 && iscons_dev (myself->ctty) - && fhandler_console::tc_getpgid () != getpgrp ()) + && fhandler_console::tc_getpgid () != myself->pgid) c_flags |= CREATE_NEW_PROCESS_GROUP; refresh_cygheap (); /* When ruid != euid we create the new process under the current original diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index d2a6704c3..901155a0e 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -1,7 +1,7 @@ /* thread.cc: Locking and threading module functions Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index a6e53a174..fd9724cbb 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -1,7 +1,7 @@ /* thread.h: Locking and threading module definitions Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, - 2008, 2009, 2010, 2011 Red Hat, Inc. + 2008, 2009, 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -9,8 +9,7 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#ifndef _THREAD_H -#define _THREAD_H +#pragma once #define LOCK_MMAP_LIST 1 @@ -714,4 +713,3 @@ struct MTinterface }; #define MT_INTERFACE user_data->threadinterface -#endif // _THREAD_H