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.
This commit is contained in:
Christopher Faylor 2012-01-11 19:07:11 +00:00
parent 5ecc040cff
commit 0e1f0840d2
13 changed files with 54 additions and 38 deletions

View File

@ -1,3 +1,21 @@
2012-01-11 Christopher Faylor <me.cygwin2012@cgf.cx>
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 <corinna@vinschen.de> 2012-01-09 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/process.h: Move here from newlib. * include/cygwin/process.h: Move here from newlib.
@ -11,7 +29,7 @@
* miscfuncs.cc (thread_wrapper): Make sure stack is 16 byte aligned * miscfuncs.cc (thread_wrapper): Make sure stack is 16 byte aligned
to make gcc-3 compiled pthread applications happy. to make gcc-3 compiled pthread applications happy.
2012-01-08 Christopher Faylor <me.cygwin2011@cgf.cx> 2012-01-08 Christopher Faylor <me.cygwin2012@cgf.cx>
* dtable.cc (dtable::stdio_init): Always initialize console when we * dtable.cc (dtable::stdio_init): Always initialize console when we
have one. have one.
@ -29,10 +47,10 @@
* cygwin.din (pthread_sigqueue): Export. * cygwin.din (pthread_sigqueue): Export.
* posix.sgml (std-gnu): Add pthread_sigqueue. * posix.sgml (std-gnu): Add pthread_sigqueue.
* thread.cc (pthread_sigqueue): New function. * 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. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2012-01-02 Christopher Faylor <me.cygwin2011@cgf.cx> 2012-01-02 Christopher Faylor <me.cygwin2012@cgf.cx>
* path.cc (get_current_dir_name): Avoid memory leak. Don't return PWD * path.cc (get_current_dir_name): Avoid memory leak. Don't return PWD
contents if directory doesn't actually exist. contents if directory doesn't actually exist.

View File

@ -1,7 +1,7 @@
/* dtable.cc: file descriptor support. /* dtable.cc: file descriptor support.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 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. This file is part of Cygwin.

View File

@ -1,7 +1,7 @@
/* fhandler.h /* fhandler.h
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 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. 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 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#ifndef _FHANDLER_H_ #pragma once
#define _FHANDLER_H_ #include "pinfo.h"
#include "tty.h" #include "tty.h"
/* fcntl flags used only internaly. */ /* fcntl flags used only internaly. */
@ -1307,7 +1307,10 @@ private:
static console_state *open_shared_console (HWND, HANDLE&, bool&); static console_state *open_shared_console (HWND, HANDLE&, bool&);
public: 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); fhandler_console (fh_devices);
static console_state *open_shared_console (HWND hw, HANDLE& h) static console_state *open_shared_console (HWND hw, HANDLE& h)
{ {
@ -2113,4 +2116,3 @@ typedef union
char __virtual[sizeof (fhandler_virtual)]; char __virtual[sizeof (fhandler_virtual)];
char __windows[sizeof (fhandler_windows)]; char __windows[sizeof (fhandler_windows)];
} fhandler_union; } fhandler_union;
#endif /* _FHANDLER_H_ */

View File

@ -14,11 +14,11 @@ details. */
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "sigproc.h"
#include "pinfo.h"
#include "path.h" #include "path.h"
#include "fhandler.h" #include "fhandler.h"
#include "dtable.h" #include "dtable.h"
#include "sigproc.h"
#include "pinfo.h"
#include "cygheap.h" #include "cygheap.h"
#include "child_info.h" #include "child_info.h"
#include "cygtls.h" #include "cygtls.h"

View File

@ -1,7 +1,7 @@
/* version.h -- Cygwin version numbers and accompanying documentation. /* version.h -- Cygwin version numbers and accompanying documentation.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 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. This file is part of Cygwin.

View File

@ -1,7 +1,7 @@
/* path.cc: path support. /* path.cc: path support.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 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. This file is part of Cygwin.

View File

@ -1,7 +1,7 @@
/* pinfo.cc: process table support /* pinfo.cc: process table support
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 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. This file is part of Cygwin.

View File

@ -1,7 +1,7 @@
/* pinfo.h: process table info /* pinfo.h: process table info
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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. 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 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#ifndef _PINFO_H #pragma once
#define _PINFO_H
#include <sys/resource.h> #include <sys/resource.h>
#include "thread.h" #include "thread.h"
@ -187,9 +187,9 @@ public:
operator _pinfo * () const {return procinfo;} operator _pinfo * () const {return procinfo;}
void preserve () { destroy = false; } void preserve () { destroy = false; }
void allow_remove () { destroy = true; } void allow_remove () { destroy = true; }
#ifndef _SIGPROC_H #ifndef SIG_BAD_MASK // kludge to ensure that sigproc.h included
int reattach () {system_printf ("reattach is not here"); return 0;} // int reattach () {system_printf ("reattach is not here"); return 0;}
int remember () {system_printf ("remember is not here"); return 0;} // int remember (bool) {system_printf ("remember is not here"); return 0;}
#else #else
int reattach () int reattach ()
{ {
@ -291,4 +291,3 @@ int __stdcall fixup_shms_after_fork ();
void __stdcall fill_rusage (struct rusage *, HANDLE); void __stdcall fill_rusage (struct rusage *, HANDLE);
void __stdcall add_rusage (struct rusage *, struct rusage *); void __stdcall add_rusage (struct rusage *, struct rusage *);
#endif /*_PINFO_H*/

View File

@ -1,7 +1,7 @@
/* sigproc.cc: inter/intra signal and sub process handler /* sigproc.cc: inter/intra signal and sub process handler
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 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. This file is part of Cygwin.
@ -14,15 +14,14 @@ details. */
#include <stdlib.h> #include <stdlib.h>
#include <sys/cygwin.h> #include <sys/cygwin.h>
#include "cygerrno.h" #include "cygerrno.h"
#include "sigproc.h"
#include "path.h" #include "path.h"
#include "fhandler.h" #include "fhandler.h"
#include "dtable.h" #include "dtable.h"
#include "sigproc.h"
#include "cygheap.h" #include "cygheap.h"
#include "child_info_magic.h" #include "child_info_magic.h"
#include "shared_info.h" #include "shared_info.h"
#include "cygtls.h" #include "cygtls.h"
#include "pinfo.h"
#include "ntdll.h" #include "ntdll.h"
/* /*

View File

@ -1,7 +1,7 @@
/* sigproc.h /* sigproc.h
Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 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. 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 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#ifndef _SIGPROC_H #pragma once
#define _SIGPROC_H
#include <signal.h> #include <signal.h>
#ifdef NSIG #ifdef NSIG
@ -62,7 +61,7 @@ extern HANDLE signal_arrived;
extern HANDLE sigCONT; extern HANDLE sigCONT;
void __stdcall sig_dispatch_pending (bool fast = false); 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&); extern "C" void __stdcall set_signal_mask (sigset_t newmask, sigset_t&);
#endif #endif
int __stdcall handle_sigprocmask (int sig, const sigset_t *set, int __stdcall handle_sigprocmask (int sig, const sigset_t *set,
@ -123,4 +122,3 @@ extern char myself_nowait_dummy[];
extern struct sigaction *global_sigs; extern struct sigaction *global_sigs;
#define myself_nowait ((_pinfo *) myself_nowait_dummy) #define myself_nowait ((_pinfo *) myself_nowait_dummy)
#endif /*_SIGPROC_H*/

View File

@ -18,16 +18,16 @@ details. */
#include <winuser.h> #include <winuser.h>
#include <wchar.h> #include <wchar.h>
#include <ctype.h> #include <ctype.h>
#include "cygerrno.h"
#include <sys/cygwin.h> #include <sys/cygwin.h>
#include "cygerrno.h"
#include "security.h" #include "security.h"
#include "sigproc.h"
#include "pinfo.h"
#include "path.h" #include "path.h"
#include "fhandler.h" #include "fhandler.h"
#include "dtable.h" #include "dtable.h"
#include "sigproc.h"
#include "cygheap.h" #include "cygheap.h"
#include "child_info.h" #include "child_info.h"
#include "pinfo.h"
#include "environ.h" #include "environ.h"
#include "cygtls.h" #include "cygtls.h"
#include "tls_pbuf.h" #include "tls_pbuf.h"
@ -337,6 +337,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
int looped = 0; int looped = 0;
HANDLE orig_wr_proc_pipe = NULL; HANDLE orig_wr_proc_pipe = NULL;
#if 0
myfault efault; myfault efault;
if (efault.faulted ()) if (efault.faulted ())
{ {
@ -347,6 +348,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
res = -1; res = -1;
goto out; goto out;
} }
#endif
child_info_types chtype; child_info_types chtype;
if (mode != _P_OVERLAY) 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 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. */ they ignore it explicitely. CREATE_NEW_PROCESS_GROUP does that for us. */
if (!iscygwin () && myself->ctty >= 0 && iscons_dev (myself->ctty) 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; c_flags |= CREATE_NEW_PROCESS_GROUP;
refresh_cygheap (); refresh_cygheap ();
/* When ruid != euid we create the new process under the current original /* When ruid != euid we create the new process under the current original

View File

@ -1,7 +1,7 @@
/* thread.cc: Locking and threading module functions /* thread.cc: Locking and threading module functions
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 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. This file is part of Cygwin.

View File

@ -1,7 +1,7 @@
/* thread.h: Locking and threading module definitions /* thread.h: Locking and threading module definitions
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 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. 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 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */ details. */
#ifndef _THREAD_H #pragma once
#define _THREAD_H
#define LOCK_MMAP_LIST 1 #define LOCK_MMAP_LIST 1
@ -714,4 +713,3 @@ struct MTinterface
}; };
#define MT_INTERFACE user_data->threadinterface #define MT_INTERFACE user_data->threadinterface
#endif // _THREAD_H