diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-04-06 11:11:07 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-04-06 11:11:07 +0000 |
commit | dafef5e249a5ddd5e9a935b802e5e61e4cc8aaa9 (patch) | |
tree | fc4915e538b760d069291c553ab4504ccc833869 /winsup/cygserver/cygserver.cc | |
parent | f0fdfd34547a1adefc71237efa9baf4efb8a7e43 (diff) | |
download | cygnal-dafef5e249a5ddd5e9a935b802e5e61e4cc8aaa9.tar.gz cygnal-dafef5e249a5ddd5e9a935b802e5e61e4cc8aaa9.tar.bz2 cygnal-dafef5e249a5ddd5e9a935b802e5e61e4cc8aaa9.zip |
* bsd_helper.cc (ipcexit_hookthread): Fix whitespace and handle leak.
* bsd_mutex.cc: Include stdlib.h, sys/msg.h and sys/sem.h.
(mtx_init): Initialize lock counter to 0.
(_mtx_lock): Increment and log mutex lock counter.
(mtx_owned): Add winpid argument. Return true only if mutex is
actually owned by process winpid.
(_mtx_assert): Add winpid argument accordingly.
(_mtx_unlock): Log owner and lock count.
(MSLEEP_MUTEX): Remove.
(MSLEEP_SEM): Ditto.
(MSLEEP_EVENT): Ditto.
(msleep_event_name): Ditto.
(msleep_cs): New global critical section.
(msleep_cnt): New global variable indicating msleep record usage.
(msleep_max_cnt): New global variable indicating msleep record size.
(msleep_arr): New global pointer to msleep records.
(msleep_init): Initialize msleep_cs. Allocate msleep_arr array.
(_msleep): Rewrite using new msleep_cs/msleep_arr based thread
synchronization. Don't be shy with debug output.
(wakeup): Rewrite using new msleep_cs/msleep_arr based thread
synchronization.
* bsd_mutex.h (struct mtx): Add lock counter for better debugging.
(mtx_owned): Declare with winpid argument.
(_mtx_assert): Ditto.
(mtx_assert): Define with winpid argument.
* cygserver.cc (version): Remove.
(SERVER_VERSION): New define, decoupling server version information
from source code control system.
(print_version): Simplify printing server version.
* process.cc (process::process): Fix wrong bracketing (and handle leak).
(process::~process): Only try to close _signal_arrived if valid.
* sysv_sem.cc: Include sys/smallprint.h.
(semundo_clear): Define with additional struct thread pointer argument.
Accomodate throughout.
(SEMUNDO_LOCKASSERT): Define with winpid argument. Accomodate
throughout.
(struct sem_undo): Define un_proc as pid_t on Cygwin. Accomodate
throughout.
(seminit): Improve debugging by adding the semid to the mutex name.
(semget): Correctly print key value as 64 bit hex value in debug
output.
(semexit_myhook): Remove Cygwin specific unlocking of mutexes owned
by exiting process. Keep semaphore global lock throughout whole
function to avoid races.
* sysv_shm.cc (GIANT_REQUIRED): Define empty on Cygwin. We know that
Giant is locked.
Diffstat (limited to 'winsup/cygserver/cygserver.cc')
-rw-r--r-- | winsup/cygserver/cygserver.cc | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/winsup/cygserver/cygserver.cc b/winsup/cygserver/cygserver.cc index 88f5e67a8..5cf82f38e 100644 --- a/winsup/cygserver/cygserver.cc +++ b/winsup/cygserver/cygserver.cc @@ -1,6 +1,6 @@ /* cygserver.cc - Copyright 2001, 2002, 2003, 2004 Red Hat Inc. + Copyright 2001, 2002, 2003, 2004, 2005 Red Hat Inc. Written by Egor Duda <deo@logos-m.ru> @@ -37,8 +37,7 @@ details. */ #define DEF_CONFIG_FILE "" SYSCONFDIR "/cygserver.conf" -// Version string. -static const char version[] = "$Revision$"; +#define SERVER_VERSION "1.12" GENERIC_MAPPING access_mapping; @@ -496,24 +495,6 @@ print_usage (const char *const pgm) static void print_version () { - char *vn = NULL; - - const char *const colon = strchr (version, ':'); - - if (!colon) - { - vn = strdup ("?"); - } - else - { - vn = strdup (colon + 2); // Skip ": " - - char *const spc = strchr (vn, ' '); - - if (spc) - *spc = '\0'; - } - char buf[200]; snprintf (buf, sizeof (buf), "%d.%d.%d(%d.%d/%d/%d)-(%d.%d.%d.%d) %s", cygwin_version.dll_major / 1000, @@ -531,12 +512,10 @@ print_version () log (LOG_INFO, "(cygwin) %s\n" "API version %s\n" - "Copyright 2001, 2002, 2003 Red Hat, Inc.\n" + "Copyright 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.\n" "Compiled on %s\n" "Default configuration file is %s", - vn, buf, __DATE__, DEF_CONFIG_FILE); - - free (vn); + SERVER_VERSION, buf, __DATE__, DEF_CONFIG_FILE); } /* |