* Throughout, fix format specifiers in debug statements to accommodate
x86_64.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | ||||
| 2014-03-12  Corinna Vinschen  <corinna@vinschen.de> | ||||
|  | ||||
| 	* Throughout, fix format specifiers in debug statements to accommodate | ||||
| 	x86_64. | ||||
|  | ||||
| 2014-03-06  Corinna Vinschen  <corinna@vinschen.de> | ||||
|  | ||||
| 	* setpwd.cc (client_request_setpwd::serve): Use RtlSecureZeroMemory to | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* bsd_helper.cc | ||||
|  | ||||
|    Copyright 2003, 2004, 2005, 2007, 2012 Red Hat Inc. | ||||
|    Copyright 2003, 2004, 2005, 2007, 2012, 2014 Red Hat Inc. | ||||
|  | ||||
| This file is part of Cygwin. | ||||
|  | ||||
| @@ -200,7 +200,7 @@ ipcexit_creat_hookthread (struct thread *td) | ||||
| 			GetCurrentProcess (), &shs->process_hdl, | ||||
| 			0, FALSE, DUPLICATE_SAME_ACCESS)) | ||||
|     { | ||||
|       log (LOG_CRIT, "failed to duplicate process handle, error = %lu", | ||||
|       log (LOG_CRIT, "failed to duplicate process handle, error = %u", | ||||
| 		      GetLastError ()); | ||||
|       return cygwin_internal (CW_GET_ERRNO_FROM_WINERROR, | ||||
| 			      GetLastError (), ENOMEM); | ||||
| @@ -209,7 +209,7 @@ ipcexit_creat_hookthread (struct thread *td) | ||||
|   HANDLE thread = CreateThread (NULL, 0, ipcexit_hookthread, shs, 0, &tid); | ||||
|   if (!thread) | ||||
|     { | ||||
|       log (LOG_CRIT, "failed to create thread, error = %lu", GetLastError ()); | ||||
|       log (LOG_CRIT, "failed to create thread, error = %u", GetLastError ()); | ||||
|       return cygwin_internal (CW_GET_ERRNO_FROM_WINERROR, | ||||
| 			      GetLastError (), ENOMEM); | ||||
|     } | ||||
| @@ -235,7 +235,7 @@ init_admin_sid (void) | ||||
|   SID_IDENTIFIER_AUTHORITY nt_auth = {SECURITY_NT_AUTHORITY}; | ||||
|   if (! AllocateAndInitializeSid (&nt_auth, 2, 32, 544, 0, 0, 0, 0, 0, 0, | ||||
| 				  &admininstrator_group_sid)) | ||||
|     panic ("failed to create well known sids, error = %lu", | ||||
|     panic ("failed to create well known sids, error = %u", | ||||
| 	   GetLastError ()); | ||||
| } | ||||
|  | ||||
| @@ -451,7 +451,7 @@ _vm_pager_allocate (int size, int shmflg) | ||||
|   vm_object_t object = CreateFileMapping (INVALID_HANDLE_VALUE, &sec_all_nih, | ||||
| 					  PAGE_READWRITE, 0, size, NULL); | ||||
|   if (!object) | ||||
|     panic ("CreateFileMapping in _vm_pager_allocate failed, %lu", GetLastError ()); | ||||
|     panic ("CreateFileMapping in _vm_pager_allocate failed, %u", GetLastError ()); | ||||
|   return object; | ||||
| } | ||||
|  | ||||
| @@ -462,7 +462,7 @@ vm_object_duplicate (struct thread *td, vm_object_t object) | ||||
|   if (!DuplicateHandle (GetCurrentProcess (), object, | ||||
| 		        td->client->handle (), &dup_object, | ||||
| 		        0, TRUE, DUPLICATE_SAME_ACCESS)) | ||||
|     panic ("!DuplicateHandle in vm_object_duplicate failed, %lu", GetLastError ()); | ||||
|     panic ("!DuplicateHandle in vm_object_duplicate failed, %u", GetLastError ()); | ||||
|   return dup_object; | ||||
| } | ||||
|  | ||||
| @@ -668,7 +668,7 @@ tunable_int_fetch (const char *name, int32_t *tunable_target) | ||||
|   if (!s->value.ival)		/* Not set in config file */ | ||||
|     return; | ||||
|   *tunable_target = s->value.ival; | ||||
|   debug ("\nSet %s to %lu\n", name, *tunable_target); | ||||
|   debug ("\nSet %s to %u\n", name, *tunable_target); | ||||
| } | ||||
|  | ||||
| void | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* bsd_mutex.cc | ||||
|  | ||||
|    Copyright 2003, 2004, 2005, 2007, 2012 Red Hat Inc. | ||||
|    Copyright 2003, 2004, 2005, 2007, 2012, 2014 Red Hat Inc. | ||||
|  | ||||
| This file is part of Cygwin. | ||||
|  | ||||
| @@ -34,7 +34,7 @@ mtx_init (mtx *m, const char *name, const void *, int) | ||||
|      unlockable by the lock owner. */ | ||||
|   m->h = CreateSemaphore (NULL, 1, 1, NULL); | ||||
|   if (!m->h) | ||||
|     panic ("couldn't allocate %s mutex, %lu\n", name, GetLastError ()); | ||||
|     panic ("couldn't allocate %s mutex, %u\n", name, GetLastError ()); | ||||
| } | ||||
|  | ||||
| void | ||||
| @@ -43,7 +43,7 @@ _mtx_lock (mtx *m, DWORD winpid, const char *file, int line) | ||||
|   _log (file, line, LOG_DEBUG, "Try locking mutex %s (%u) (hold: %u)", | ||||
| 	m->name, winpid, m->owner); | ||||
|   if (WaitForSingleObject (m->h, INFINITE) != WAIT_OBJECT_0) | ||||
|     _panic (file, line, "wait for %s in %d failed, %lu", m->name, winpid, | ||||
|     _panic (file, line, "wait for %s in %d failed, %u", m->name, winpid, | ||||
| 	    GetLastError ()); | ||||
|   m->owner = winpid; | ||||
|   _log (file, line, LOG_DEBUG, "Locked      mutex %s/%u (%u)", | ||||
| @@ -86,7 +86,7 @@ _mtx_unlock (mtx *m, const char *file, int line) | ||||
|     { | ||||
|       /* Check if the semaphore was already on it's max value. */ | ||||
|       if (GetLastError () != ERROR_TOO_MANY_POSTS) | ||||
| 	_panic (file, line, "release of mutex %s failed, %lu", m->name, | ||||
| 	_panic (file, line, "release of mutex %s failed, %u", m->name, | ||||
| 		GetLastError ()); | ||||
|     } | ||||
|   _log (file, line, LOG_DEBUG, "Unlocked    mutex %s/%u (owner: %u)", | ||||
| @@ -141,7 +141,7 @@ set_priority (int priority) | ||||
|   int old_prio = GetThreadPriority (GetCurrentThread ()); | ||||
|   if (!SetThreadPriority (GetCurrentThread (), win_priority (priority))) | ||||
|     log (LOG_WARNING, | ||||
|     	  "Warning: Setting thread priority to %d failed with error %lu\n", | ||||
|     	  "Warning: Setting thread priority to %d failed with error %u\n", | ||||
| 	  win_priority (priority), GetLastError ()); | ||||
|   return old_prio; | ||||
| } | ||||
| @@ -201,7 +201,7 @@ class msleep_sync_array | ||||
|     a[i].ident = ident; | ||||
|     a[i].wakeup_evt = CreateEvent (NULL, TRUE, FALSE, NULL); | ||||
|     if (!a[i].wakeup_evt) | ||||
|       panic ("CreateEvent failed: %lu", GetLastError ()); | ||||
|       panic ("CreateEvent failed: %u", GetLastError ()); | ||||
|     debug ("i = %d, CreateEvent: %x", i, a[i].wakeup_evt); | ||||
|     a[i].threads = 1; | ||||
|     ++cnt; | ||||
| @@ -284,7 +284,7 @@ msleep_init (void) | ||||
|  | ||||
|   msleep_glob_evt = CreateEvent (NULL, TRUE, FALSE, NULL); | ||||
|   if (!msleep_glob_evt) | ||||
|     panic ("CreateEvent in msleep_init failed: %lu", GetLastError ()); | ||||
|     panic ("CreateEvent in msleep_init failed: %u", GetLastError ()); | ||||
|   int32_t msgmni = support_msgqueues ? msginfo.msgmni : 0; | ||||
|   int32_t semmni = support_semaphores ? seminfo.semmni : 0; | ||||
|   TUNABLE_INT_FETCH ("kern.ipc.msgmni", &msgmni); | ||||
| @@ -348,8 +348,8 @@ _msleep (void *ident, struct mtx *mtx, int priority, | ||||
| 	   treat an ERROR_INVALID_HANDLE as a normal process termination and | ||||
| 	   hope for the best. */ | ||||
| 	if (GetLastError () != ERROR_INVALID_HANDLE) | ||||
| 	  panic ("wait in msleep (%s) failed, %lu", wmesg, GetLastError ()); | ||||
| 	debug ("wait in msleep (%s) failed for %d, %lu", wmesg, | ||||
| 	  panic ("wait in msleep (%s) failed, %u", wmesg, GetLastError ()); | ||||
| 	debug ("wait in msleep (%s) failed for %d, %u", wmesg, | ||||
| 	       td->td_proc->winpid, GetLastError ()); | ||||
| 	ret = EIDRM; | ||||
| 	break; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* client.cc | ||||
|  | ||||
|    Copyright 2001, 2002, 2003, 2004, 2008, 2009, 2012, 2013 Red Hat Inc. | ||||
|    Copyright 2001, 2002, 2003, 2004, 2008, 2009, 2012, 2013, 2014 Red Hat Inc. | ||||
|  | ||||
|    Written by Egor Duda <deo@logos-m.ru> | ||||
|  | ||||
| @@ -60,7 +60,7 @@ client_request_get_version::check_version () const | ||||
|   if (!ok) | ||||
|     syscall_printf (("incompatible version of cygwin server: " | ||||
| 		     "client version %d.%d.%d.%d, " | ||||
| 		     "server version %ld.%ld.%ld.%ld"), | ||||
| 		     "server version %d.%d.%d.%d"), | ||||
| 		    CYGWIN_SERVER_VERSION_MAJOR, | ||||
| 		    CYGWIN_SERVER_VERSION_API, | ||||
| 		    CYGWIN_SERVER_VERSION_MINOR, | ||||
| @@ -83,8 +83,8 @@ client_request_attach_tty::client_request_attach_tty (DWORD nmaster_pid, | ||||
|   req.from_master = nfrom_master; | ||||
|   req.to_master = nto_master; | ||||
|  | ||||
|   syscall_printf (("created: pid = %lu, master_pid = %lu, " | ||||
| 		   "from_master = %lu, to_master = %lu"), | ||||
|   syscall_printf (("created: pid = %u, master_pid = %u, " | ||||
| 		   "from_master = %p, to_master = %p"), | ||||
| 		  req.pid, req.master_pid, req.from_master, req.to_master); | ||||
| } | ||||
| #endif /* __INSIDE_CYGWIN__ */ | ||||
| @@ -139,8 +139,8 @@ client_request::send (transport_layer_base * const conn) | ||||
| 	assert (errno); | ||||
| 	error_code (errno); | ||||
| 	syscall_printf (("request header write failure: " | ||||
| 			 "only %ld bytes sent of %ld, " | ||||
| 			 "error = %d(%lu)"), | ||||
| 			 "only %lu bytes sent of %lu, " | ||||
| 			 "error = %d(%u)"), | ||||
| 			count, sizeof (_header), | ||||
| 			errno, GetLastError ()); | ||||
| 	return; | ||||
| @@ -156,17 +156,14 @@ client_request::send (transport_layer_base * const conn) | ||||
| 	  assert (errno); | ||||
| 	  error_code (errno); | ||||
| 	  syscall_printf (("request body write failure: " | ||||
| 			   "only %ld bytes sent of %ld, " | ||||
| 			   "error = %d(%lu)"), | ||||
| 			   "only %lu bytes sent of %lu, " | ||||
| 			   "error = %d(%u)"), | ||||
| 			  count, msglen (), | ||||
| 			  errno, GetLastError ()); | ||||
| 	  return; | ||||
| 	} | ||||
|     } | ||||
|  | ||||
|   // verbose: syscall_printf ("request sent (%ld + %ld bytes)", | ||||
|   //			      sizeof (_header), msglen ()); | ||||
|  | ||||
|   { | ||||
|     const ssize_t count = conn->read (&_header, sizeof (_header)); | ||||
|  | ||||
| @@ -175,8 +172,8 @@ client_request::send (transport_layer_base * const conn) | ||||
| 	assert (errno); | ||||
| 	error_code (errno); | ||||
| 	syscall_printf (("reply header read failure: " | ||||
| 			 "only %ld bytes received of %ld, " | ||||
| 			 "error = %d(%lu)"), | ||||
| 			 "only %lu bytes received of %lu, " | ||||
| 			 "error = %d(%u)"), | ||||
| 			count, sizeof (_header), | ||||
| 			errno, GetLastError ()); | ||||
| 	return; | ||||
| @@ -185,7 +182,7 @@ client_request::send (transport_layer_base * const conn) | ||||
|  | ||||
|   if (msglen () && !_buf) | ||||
|     { | ||||
|       system_printf ("no client buffer for reply body: %ld bytes needed", | ||||
|       system_printf ("no client buffer for reply body: %lu bytes needed", | ||||
| 		     msglen ()); | ||||
|       error_code (EINVAL); | ||||
|       return; | ||||
| @@ -194,7 +191,7 @@ client_request::send (transport_layer_base * const conn) | ||||
|   if (msglen () > _buflen) | ||||
|     { | ||||
|       system_printf (("client buffer too small for reply body: " | ||||
| 		      "have %ld bytes and need %ld"), | ||||
| 		      "have %lu bytes and need %lu"), | ||||
| 		     _buflen, msglen ()); | ||||
|       error_code (EINVAL); | ||||
|       return; | ||||
| @@ -209,16 +206,13 @@ client_request::send (transport_layer_base * const conn) | ||||
| 	  assert (errno); | ||||
| 	  error_code (errno); | ||||
| 	  syscall_printf (("reply body read failure: " | ||||
| 			   "only %ld bytes received of %ld, " | ||||
| 			   "error = %d(%lu)"), | ||||
| 			   "only %lu bytes received of %lu, " | ||||
| 			   "error = %d(%u)"), | ||||
| 			  count, msglen (), | ||||
| 			  errno, GetLastError ()); | ||||
| 	  return; | ||||
| 	} | ||||
|     } | ||||
|  | ||||
|   // verbose: syscall_printf ("reply received (%ld + %ld bytes)", | ||||
|   //			      sizeof (_header), msglen ()); | ||||
| } | ||||
|  | ||||
| #ifdef __OUTSIDE_CYGWIN__ | ||||
| @@ -258,14 +252,12 @@ client_request::handle_request (transport_layer_base *const conn, | ||||
|     if (count != sizeof (header)) | ||||
|       { | ||||
| 	syscall_printf (("request header read failure: " | ||||
| 			 "only %ld bytes received of %ld, " | ||||
| 			 "error = %d(%lu)"), | ||||
| 			 "only %lu bytes received of %lu, " | ||||
| 			 "error = %d(%u)"), | ||||
| 			count, sizeof (header), | ||||
| 			errno, GetLastError ()); | ||||
| 	return; | ||||
|       } | ||||
|  | ||||
|       // verbose: debug_printf ("got header (%ld)", count); | ||||
|   } | ||||
|  | ||||
|   client_request *req = NULL; | ||||
| @@ -330,7 +322,7 @@ client_request::handle (transport_layer_base *const conn, | ||||
| { | ||||
|   if (msglen () && !_buf) | ||||
|     { | ||||
|       system_printf ("no buffer for request body: %ld bytes needed", | ||||
|       system_printf ("no buffer for request body: %lu bytes needed", | ||||
| 		     msglen ()); | ||||
|       error_code (EINVAL); | ||||
|       return; | ||||
| @@ -339,7 +331,7 @@ client_request::handle (transport_layer_base *const conn, | ||||
|   if (msglen () > _buflen) | ||||
|     { | ||||
|       system_printf (("buffer too small for request body: " | ||||
| 		      "have %ld bytes and need %ld"), | ||||
| 		      "have %lu bytes and need %lu"), | ||||
| 		     _buflen, msglen ()); | ||||
|       error_code (EINVAL); | ||||
|       return; | ||||
| @@ -354,17 +346,14 @@ client_request::handle (transport_layer_base *const conn, | ||||
| 	  assert (errno); | ||||
| 	  error_code (errno); | ||||
| 	  syscall_printf (("request body read failure: " | ||||
| 			   "only %ld bytes received of %ld, " | ||||
| 			   "error = %d(%lu)"), | ||||
| 			   "only %lu bytes received of %lu, " | ||||
| 			   "error = %d(%u)"), | ||||
| 			  count, msglen (), | ||||
| 			  errno, GetLastError ()); | ||||
| 	  return; | ||||
| 	} | ||||
|     } | ||||
|  | ||||
|   // verbose: syscall_printf ("request received (%ld + %ld bytes)", | ||||
|   //			      sizeof (_header), msglen ()); | ||||
|  | ||||
|   error_code (0);		// Overwrites the _header.request_code field. | ||||
|  | ||||
|   /* | ||||
| @@ -381,8 +370,8 @@ client_request::handle (transport_layer_base *const conn, | ||||
| 	assert (errno); | ||||
| 	error_code (errno); | ||||
| 	syscall_printf (("reply header write failure: " | ||||
| 			 "only %ld bytes sent of %ld, " | ||||
| 			 "error = %d(%lu)"), | ||||
| 			 "only %lu bytes sent of %lu, " | ||||
| 			 "error = %d(%u)"), | ||||
| 			count, sizeof (_header), | ||||
| 			errno, GetLastError ()); | ||||
| 	return; | ||||
| @@ -398,16 +387,13 @@ client_request::handle (transport_layer_base *const conn, | ||||
| 	  assert (errno); | ||||
| 	  error_code (errno); | ||||
| 	  syscall_printf (("reply body write failure: " | ||||
| 			   "only %ld bytes sent of %ld, " | ||||
| 			   "error = %d(%lu)"), | ||||
| 			   "only %lu bytes sent of %lu, " | ||||
| 			   "error = %d(%u)"), | ||||
| 			  count, msglen (), | ||||
| 			  errno, GetLastError ()); | ||||
| 	  return; | ||||
| 	} | ||||
|     } | ||||
|  | ||||
|   // verbose: syscall_printf ("reply sent (%ld + %ld bytes)", | ||||
|   //			      sizeof (_header), msglen ()); | ||||
| } | ||||
|  | ||||
| /* The server side implementation of make_request.  Very simple. */ | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* cygserver.cc | ||||
|  | ||||
|    Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2011, 2012 Red Hat Inc. | ||||
|    Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2011, 2012, 2014 Red Hat Inc. | ||||
|  | ||||
|    Written by Egor Duda <deo@logos-m.ru> | ||||
|  | ||||
| @@ -180,10 +180,10 @@ client_request_attach_tty::serve (transport_layer_base *const conn, | ||||
|  | ||||
|   msglen (0);			// Until we fill in some fields. | ||||
|  | ||||
|   debug ("pid %ld:(%p,%p) -> pid %ld", req.master_pid, req.from_master, | ||||
|   debug ("pid %d:(%p,%p) -> pid %d", req.master_pid, req.from_master, | ||||
| 				       req.to_master, req.pid); | ||||
|  | ||||
|   debug ("opening process %ld", req.master_pid); | ||||
|   debug ("opening process %d", req.master_pid); | ||||
|  | ||||
|   const HANDLE from_process_handle = | ||||
|     OpenProcess (PROCESS_DUP_HANDLE, FALSE, req.master_pid); | ||||
| @@ -195,7 +195,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn, | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|   debug ("opening process %ld", req.pid); | ||||
|   debug ("opening process %d", req.pid); | ||||
|  | ||||
|   const HANDLE to_process_handle = | ||||
|     OpenProcess (PROCESS_DUP_HANDLE, FALSE, req.pid); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* process.cc | ||||
|  | ||||
|    Copyright 2001, 2002, 2003, 2004, 2005 Red Hat Inc. | ||||
|    Copyright 2001, 2002, 2003, 2004, 2005, 2014 Red Hat Inc. | ||||
|  | ||||
|    Written by Robert Collins <rbtcollins@hotmail.com> | ||||
|  | ||||
| @@ -52,16 +52,16 @@ process::process (const pid_t cygpid, const DWORD winpid, HANDLE signal_arrived) | ||||
|   _hProcess = OpenProcess (PROCESS_ALL_ACCESS, FALSE, winpid); | ||||
|   if (!_hProcess) | ||||
|     { | ||||
|       system_printf ("unable to obtain handle for new cache process %d(%lu)", | ||||
|       system_printf ("unable to obtain handle for new cache process %d(%u)", | ||||
| 		     _cygpid, _winpid); | ||||
|       _hProcess = INVALID_HANDLE_VALUE; | ||||
|       _exit_status = 0; | ||||
|     } | ||||
|   else | ||||
|     debug_printf ("got handle %p for new cache process %d(%lu)", | ||||
|     debug_printf ("got handle %p for new cache process %d(%u)", | ||||
| 		  _hProcess, _cygpid, _winpid); | ||||
|   if (!signal_arrived) | ||||
|     system_printf ("signal_arrived NULL for process %d(%lu)", | ||||
|     system_printf ("signal_arrived NULL for process %d(%u)", | ||||
| 		   _cygpid, _winpid); | ||||
|   else if (signal_arrived != INVALID_HANDLE_VALUE) | ||||
|     { | ||||
| @@ -69,18 +69,18 @@ process::process (const pid_t cygpid, const DWORD winpid, HANDLE signal_arrived) | ||||
| 			    GetCurrentProcess (), &_signal_arrived, | ||||
| 			    0, FALSE, DUPLICATE_SAME_ACCESS)) | ||||
| 	{ | ||||
| 	  system_printf ("error getting signal_arrived to server (%lu)", | ||||
| 	  system_printf ("error getting signal_arrived to server (%u)", | ||||
| 			 GetLastError ()); | ||||
| 	  _signal_arrived = INVALID_HANDLE_VALUE; | ||||
| 	} | ||||
|     } | ||||
|   InitializeCriticalSection (&_access); | ||||
|   debug ("initialized (%lu)", _cygpid); | ||||
|   debug ("initialized (%u)", _cygpid); | ||||
| } | ||||
|  | ||||
| process::~process () | ||||
| { | ||||
|   debug ("deleting (%lu)", _cygpid); | ||||
|   debug ("deleting (%u)", _cygpid); | ||||
|   DeleteCriticalSection (&_access); | ||||
|   if (_signal_arrived && _signal_arrived != INVALID_HANDLE_VALUE) | ||||
|     CloseHandle (_signal_arrived); | ||||
| @@ -100,7 +100,7 @@ process::check_exit_code () | ||||
|       && _exit_status == STILL_ACTIVE | ||||
|       && !GetExitCodeProcess (_hProcess, &_exit_status)) | ||||
|     { | ||||
|       system_printf ("failed to retrieve exit code for %d(%lu), error = %lu", | ||||
|       system_printf ("failed to retrieve exit code for %d(%u), error = %u", | ||||
| 		     _cygpid, _winpid, GetLastError ()); | ||||
|       _hProcess = INVALID_HANDLE_VALUE; | ||||
|     } | ||||
| @@ -218,7 +218,7 @@ process_cache::process_cache (const size_t max_procs, | ||||
|  | ||||
|   if (!_cache_add_trigger) | ||||
|     { | ||||
|       system_printf ("failed to create cache add trigger, error = %lu", | ||||
|       system_printf ("failed to create cache add trigger, error = %u", | ||||
| 		     GetLastError ()); | ||||
|       abort (); | ||||
|     } | ||||
| @@ -256,7 +256,7 @@ process_cache::process (const pid_t cygpid, const DWORD winpid, | ||||
| 	{ | ||||
| 	  LeaveCriticalSection (&_cache_write_access); | ||||
| 	  system_printf (("process limit (%d processes) reached; " | ||||
| 			  "new connection refused for %d(%lu)"), | ||||
| 			  "new connection refused for %d(%u)"), | ||||
| 			 _max_process_count, cygpid, winpid); | ||||
| 	  return NULL; | ||||
| 	} | ||||
| @@ -326,7 +326,7 @@ process_cache::wait_for_processes (const HANDLE interrupt_event) | ||||
|       rc = WaitForMultipleObjects (count, _wait_array, FALSE, INFINITE); | ||||
|       if (rc == WAIT_FAILED) | ||||
| 	{ | ||||
| 	  system_printf ("could not wait on the process handles, error = %lu", | ||||
| 	  system_printf ("could not wait on the process handles, error = %u", | ||||
| 			 GetLastError ()); | ||||
| 	  abort (); | ||||
| 	} | ||||
| @@ -349,7 +349,7 @@ process_cache::wait_for_processes (const HANDLE interrupt_event) | ||||
|       rc = WaitForMultipleObjects (mcount, main_wait_array, FALSE, INFINITE); | ||||
|       if (rc == WAIT_FAILED) | ||||
| 	{ | ||||
| 	  system_printf ("could not wait on the process handles, error = %lu", | ||||
| 	  system_printf ("could not wait on the process handles, error = %u", | ||||
| 			 GetLastError ()); | ||||
| 	  abort (); | ||||
| 	} | ||||
| @@ -358,7 +358,7 @@ process_cache::wait_for_processes (const HANDLE interrupt_event) | ||||
|       GetExitCodeThread (main_wait_array[rc], &rc); | ||||
|       if (rc == WAIT_FAILED) | ||||
| 	{ | ||||
| 	  system_printf ("could not wait on the process handles, error = %lu", | ||||
| 	  system_printf ("could not wait on the process handles, error = %u", | ||||
| 			 GetLastError ()); | ||||
| 	  abort (); | ||||
| 	} | ||||
| @@ -453,7 +453,7 @@ process_cache::check_and_remove_process (const size_t index) | ||||
|   if (process->check_exit_code () == STILL_ACTIVE) | ||||
|     return; | ||||
|  | ||||
|   debug_printf ("process %d(%lu) has left the building ($? = %lu)", | ||||
|   debug_printf ("process %d(%u) has left the building ($? = %u)", | ||||
| 		process->_cygpid, process->_winpid, process->_exit_status); | ||||
|  | ||||
|   /* Unlink the process object from the process list. */ | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* threaded_queue.cc | ||||
|  | ||||
|    Copyright 2001, 2002, 2003 Red Hat Inc. | ||||
|    Copyright 2001, 2002, 2003, 2014 Red Hat Inc. | ||||
|  | ||||
|    Written by Robert Collins <rbtcollins@hotmail.com> | ||||
|  | ||||
| @@ -55,7 +55,7 @@ threaded_queue::threaded_queue (const size_t initial_workers) | ||||
|   if (!_requests_sem) | ||||
|     { | ||||
|       system_printf (("failed to create the request queue semaphore, " | ||||
| 		      "error = %lu"), | ||||
| 		      "error = %u"), | ||||
| 		     GetLastError ()); | ||||
|       abort (); | ||||
|     } | ||||
| @@ -145,7 +145,7 @@ threaded_queue::stop () | ||||
|       while (_workers_count) | ||||
| 	{ | ||||
| 	  debug_printf (("waiting for worker threads to terminate: " | ||||
| 			 "%lu still running"), | ||||
| 			 "%u still running"), | ||||
| 			_workers_count); | ||||
| 	  Sleep (1000); | ||||
| 	} | ||||
| @@ -228,7 +228,7 @@ threaded_queue::create_workers (const size_t initial_workers) | ||||
|  | ||||
|       if (!hThread) | ||||
| 	{ | ||||
| 	  system_printf ("failed to create thread, error = %lu", | ||||
| 	  system_printf ("failed to create thread, error = %u", | ||||
| 			 GetLastError ()); | ||||
| 	  abort (); | ||||
| 	} | ||||
| @@ -245,7 +245,7 @@ threaded_queue::worker_loop () | ||||
|       const DWORD rc = WaitForSingleObject (_requests_sem, INFINITE); | ||||
|       if (rc == WAIT_FAILED) | ||||
| 	{ | ||||
| 	  system_printf ("wait for request semaphore failed, error = %lu", | ||||
| 	  system_printf ("wait for request semaphore failed, error = %u", | ||||
| 			 GetLastError ()); | ||||
| 	  return; | ||||
| 	} | ||||
| @@ -297,7 +297,7 @@ queue_submission_loop::queue_submission_loop (threaded_queue *const queue, | ||||
|  | ||||
|       if (!_interrupt_event) | ||||
| 	{ | ||||
| 	  system_printf ("failed to create interrupt event, error = %lu", | ||||
| 	  system_printf ("failed to create interrupt event, error = %u", | ||||
| 			 GetLastError ()); | ||||
| 	  abort (); | ||||
| 	} | ||||
| @@ -329,7 +329,7 @@ queue_submission_loop::start () | ||||
|       _hThread = CreateThread (NULL, 0, start_routine, this, 0, &_tid); | ||||
|       if (!_hThread) | ||||
| 	{ | ||||
| 	  system_printf ("failed to create thread, error = %lu", | ||||
| 	  system_printf ("failed to create thread, error = %u", | ||||
| 			 GetLastError ()); | ||||
| 	  abort (); | ||||
| 	} | ||||
| @@ -359,14 +359,14 @@ queue_submission_loop::stop () | ||||
|  | ||||
| 	  if (WaitForSingleObject (_hThread, 1000) == WAIT_TIMEOUT) | ||||
| 	    { | ||||
| 	      system_printf (("request loop thread %lu failed to shutdown " | ||||
| 	      system_printf (("request loop thread %u failed to shutdown " | ||||
| 			      "when asked politely: about to get heavy"), | ||||
| 			     _tid); | ||||
|  | ||||
| 	      if (!TerminateThread (_hThread, 0)) | ||||
| 		{ | ||||
| 		  system_printf (("failed to kill request loop thread %lu" | ||||
| 				  ", error = %lu"), | ||||
| 		  system_printf (("failed to kill request loop thread %u" | ||||
| 				  ", error = %u"), | ||||
| 				 _tid, GetLastError ()); | ||||
| 		  abort (); | ||||
| 		} | ||||
| @@ -378,11 +378,11 @@ queue_submission_loop::stop () | ||||
| 	  // the submission loop is no longer running and shuts down | ||||
| 	  // voluntarily. | ||||
|  | ||||
| 	  debug_printf ("killing request loop thread %lu", _tid); | ||||
| 	  debug_printf ("killing request loop thread %u", _tid); | ||||
|  | ||||
| 	  if (!TerminateThread (_hThread, 0)) | ||||
| 	    system_printf (("failed to kill request loop thread %lu" | ||||
| 			    ", error = %lu"), | ||||
| 	    system_printf (("failed to kill request loop thread %u" | ||||
| 			    ", error = %u"), | ||||
| 			   _tid, GetLastError ()); | ||||
| 	} | ||||
|     } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* transport_pipes.cc | ||||
|  | ||||
|    Copyright 2001, 2002, 2003, 2004, 2009, 2012 Red Hat Inc. | ||||
|    Copyright 2001, 2002, 2003, 2004, 2009, 2012, 2014 Red Hat Inc. | ||||
|  | ||||
|    Written by Robert Collins <rbtcollins@hotmail.com> | ||||
|  | ||||
| @@ -137,7 +137,7 @@ transport_layer_pipes::accept (bool *const recoverable) | ||||
|  | ||||
|   if (accept_pipe == INVALID_HANDLE_VALUE) | ||||
|     { | ||||
|       debug_printf ("error creating pipe (%lu).", GetLastError ()); | ||||
|       debug_printf ("error creating pipe (%u).", GetLastError ()); | ||||
|       *recoverable = true;	// FIXME: case analysis? | ||||
|       return NULL; | ||||
|     } | ||||
| @@ -145,7 +145,7 @@ transport_layer_pipes::accept (bool *const recoverable) | ||||
|   if (!ConnectNamedPipe (accept_pipe, NULL) | ||||
|       && GetLastError () != ERROR_PIPE_CONNECTED) | ||||
|     { | ||||
|       debug_printf ("error connecting to pipe (%lu)", GetLastError ()); | ||||
|       debug_printf ("error connecting to pipe (%u)", GetLastError ()); | ||||
|       (void) CloseHandle (accept_pipe); | ||||
|       *recoverable = true;	// FIXME: case analysis? | ||||
|       return NULL; | ||||
| @@ -199,7 +199,7 @@ transport_layer_pipes::read (void *const buf, const size_t len) | ||||
|   DWORD count; | ||||
|   if (!ReadFile (_hPipe, buf, len, &count, NULL)) | ||||
|     { | ||||
|       debug_printf ("error reading from pipe (%lu)", GetLastError ()); | ||||
|       debug_printf ("error reading from pipe (%u)", GetLastError ()); | ||||
|       SET_ERRNO (EINVAL);	// FIXME? | ||||
|       return -1; | ||||
|     } | ||||
| @@ -219,7 +219,7 @@ transport_layer_pipes::write (void *const buf, const size_t len) | ||||
|   DWORD count; | ||||
|   if (!WriteFile (_hPipe, buf, len, &count, NULL)) | ||||
|     { | ||||
|       debug_printf ("error writing to pipe, error = %lu", GetLastError ()); | ||||
|       debug_printf ("error writing to pipe, error = %u", GetLastError ()); | ||||
|       SET_ERRNO (EINVAL);	// FIXME? | ||||
|       return -1; | ||||
|     } | ||||
| @@ -273,7 +273,7 @@ transport_layer_pipes::connect () | ||||
|  | ||||
|       if (!assume_cygserver && GetLastError () != ERROR_PIPE_BUSY) | ||||
| 	{ | ||||
| 	  debug_printf ("Error opening the pipe (%lu)", GetLastError ()); | ||||
| 	  debug_printf ("Error opening the pipe (%u)", GetLastError ()); | ||||
| 	  return -1; | ||||
| 	} | ||||
|  | ||||
| @@ -294,7 +294,7 @@ transport_layer_pipes::connect () | ||||
|  | ||||
|   assert (retries == MAX_WAIT_NAMED_PIPE_RETRY); | ||||
|  | ||||
|   system_printf ("lost connection to cygserver, error = %lu", | ||||
|   system_printf ("lost connection to cygserver, error = %u", | ||||
| 		 GetLastError ()); | ||||
|  | ||||
|   assume_cygserver = false; | ||||
| @@ -313,7 +313,7 @@ transport_layer_pipes::impersonate_client () | ||||
|  | ||||
|   if (_hPipe && !ImpersonateNamedPipeClient (_hPipe)) | ||||
|     { | ||||
|       debug_printf ("Failed to Impersonate client, (%lu)", GetLastError ()); | ||||
|       debug_printf ("Failed to Impersonate client, (%u)", GetLastError ()); | ||||
|       return false; | ||||
|     } | ||||
|  | ||||
| @@ -327,7 +327,7 @@ transport_layer_pipes::revert_to_self () | ||||
|  | ||||
|   if (!RevertToSelf ()) | ||||
|     { | ||||
|       debug_printf ("Failed to RevertToSelf, (%lu)", GetLastError ()); | ||||
|       debug_printf ("Failed to RevertToSelf, (%u)", GetLastError ()); | ||||
|       return false; | ||||
|     } | ||||
|   return true; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user