* bsd_helper.cc: Replace %E __small_printf format specifier with %lu
and call to GetLastError throughout. * bsd_mutex.cc: Ditto. * sysv_sem.cc (semget): Replace %X __small_printf format specifier with %llx.
This commit is contained in:
parent
93591f4200
commit
62688407cb
|
@ -1,3 +1,11 @@
|
||||||
|
2008-02-06 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* bsd_helper.cc: Replace %E __small_printf format specifier with %lu
|
||||||
|
and call to GetLastError throughout.
|
||||||
|
* bsd_mutex.cc: Ditto.
|
||||||
|
* sysv_sem.cc (semget): Replace %X __small_printf format specifier
|
||||||
|
with %llx.
|
||||||
|
|
||||||
2008-02-06 Corinna Vinschen <corinna@vinschen.de>
|
2008-02-06 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
Remove dependency from Cygwin internal code.
|
Remove dependency from Cygwin internal code.
|
||||||
|
|
|
@ -451,7 +451,7 @@ _vm_pager_allocate (int size, int shmflg)
|
||||||
vm_object_t object = CreateFileMapping (INVALID_HANDLE_VALUE, &sec_all_nih,
|
vm_object_t object = CreateFileMapping (INVALID_HANDLE_VALUE, &sec_all_nih,
|
||||||
PAGE_READWRITE, 0, size, NULL);
|
PAGE_READWRITE, 0, size, NULL);
|
||||||
if (!object)
|
if (!object)
|
||||||
panic ("CreateFileMapping in _vm_pager_allocate failed, %E");
|
panic ("CreateFileMapping in _vm_pager_allocate failed, %lu", GetLastError ());
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ vm_object_duplicate (struct thread *td, vm_object_t object)
|
||||||
if (!DuplicateHandle (GetCurrentProcess (), object,
|
if (!DuplicateHandle (GetCurrentProcess (), object,
|
||||||
td->client->handle (), &dup_object,
|
td->client->handle (), &dup_object,
|
||||||
0, TRUE, DUPLICATE_SAME_ACCESS))
|
0, TRUE, DUPLICATE_SAME_ACCESS))
|
||||||
panic ("!DuplicateHandle in vm_object_duplicate failed, %E");
|
panic ("!DuplicateHandle in vm_object_duplicate failed, %lu", GetLastError ());
|
||||||
return dup_object;
|
return dup_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ mtx_init (mtx *m, const char *name, const void *, int)
|
||||||
unlockable by the lock owner. */
|
unlockable by the lock owner. */
|
||||||
m->h = CreateSemaphore (NULL, 1, 1, NULL);
|
m->h = CreateSemaphore (NULL, 1, 1, NULL);
|
||||||
if (!m->h)
|
if (!m->h)
|
||||||
panic ("couldn't allocate %s mutex, %E\n", name);
|
panic ("couldn't allocate %s mutex, %lu\n", name, GetLastError ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -43,7 +43,8 @@ _mtx_lock (mtx *m, DWORD winpid, const char *file, int line)
|
||||||
_log (file, line, LOG_DEBUG, "Try locking mutex %s (%u) (hold: %u)",
|
_log (file, line, LOG_DEBUG, "Try locking mutex %s (%u) (hold: %u)",
|
||||||
m->name, winpid, m->owner);
|
m->name, winpid, m->owner);
|
||||||
if (WaitForSingleObject (m->h, INFINITE) != WAIT_OBJECT_0)
|
if (WaitForSingleObject (m->h, INFINITE) != WAIT_OBJECT_0)
|
||||||
_panic (file, line, "wait for %s in %d failed, %E", m->name, winpid);
|
_panic (file, line, "wait for %s in %d failed, %lu", m->name, winpid,
|
||||||
|
GetLastError ());
|
||||||
m->owner = winpid;
|
m->owner = winpid;
|
||||||
_log (file, line, LOG_DEBUG, "Locked mutex %s/%u (%u)",
|
_log (file, line, LOG_DEBUG, "Locked mutex %s/%u (%u)",
|
||||||
m->name, ++m->cnt, winpid);
|
m->name, ++m->cnt, winpid);
|
||||||
|
@ -85,7 +86,8 @@ _mtx_unlock (mtx *m, const char *file, int line)
|
||||||
{
|
{
|
||||||
/* Check if the semaphore was already on it's max value. */
|
/* Check if the semaphore was already on it's max value. */
|
||||||
if (GetLastError () != ERROR_TOO_MANY_POSTS)
|
if (GetLastError () != ERROR_TOO_MANY_POSTS)
|
||||||
_panic (file, line, "release of mutex %s failed, %E", m->name);
|
_panic (file, line, "release of mutex %s failed, %lu", m->name,
|
||||||
|
GetLastError ());
|
||||||
}
|
}
|
||||||
_log (file, line, LOG_DEBUG, "Unlocked mutex %s/%u (owner: %u)",
|
_log (file, line, LOG_DEBUG, "Unlocked mutex %s/%u (owner: %u)",
|
||||||
m->name, cnt, owner);
|
m->name, cnt, owner);
|
||||||
|
@ -199,7 +201,7 @@ class msleep_sync_array
|
||||||
a[i].ident = ident;
|
a[i].ident = ident;
|
||||||
a[i].wakeup_evt = CreateEvent (NULL, TRUE, FALSE, NULL);
|
a[i].wakeup_evt = CreateEvent (NULL, TRUE, FALSE, NULL);
|
||||||
if (!a[i].wakeup_evt)
|
if (!a[i].wakeup_evt)
|
||||||
panic ("CreateEvent failed: %E");
|
panic ("CreateEvent failed: %lu", GetLastError ());
|
||||||
debug ("i = %d, CreateEvent: %x", i, a[i].wakeup_evt);
|
debug ("i = %d, CreateEvent: %x", i, a[i].wakeup_evt);
|
||||||
a[i].threads = 1;
|
a[i].threads = 1;
|
||||||
++cnt;
|
++cnt;
|
||||||
|
@ -282,7 +284,7 @@ msleep_init (void)
|
||||||
|
|
||||||
msleep_glob_evt = CreateEvent (NULL, TRUE, FALSE, NULL);
|
msleep_glob_evt = CreateEvent (NULL, TRUE, FALSE, NULL);
|
||||||
if (!msleep_glob_evt)
|
if (!msleep_glob_evt)
|
||||||
panic ("CreateEvent in msleep_init failed: %E");
|
panic ("CreateEvent in msleep_init failed: %lu", GetLastError ());
|
||||||
long msgmni = support_msgqueues ? msginfo.msgmni : 0;
|
long msgmni = support_msgqueues ? msginfo.msgmni : 0;
|
||||||
long semmni = support_semaphores ? seminfo.semmni : 0;
|
long semmni = support_semaphores ? seminfo.semmni : 0;
|
||||||
TUNABLE_INT_FETCH ("kern.ipc.msgmni", &msgmni);
|
TUNABLE_INT_FETCH ("kern.ipc.msgmni", &msgmni);
|
||||||
|
@ -346,9 +348,9 @@ _msleep (void *ident, struct mtx *mtx, int priority,
|
||||||
treat an ERROR_INVALID_HANDLE as a normal process termination and
|
treat an ERROR_INVALID_HANDLE as a normal process termination and
|
||||||
hope for the best. */
|
hope for the best. */
|
||||||
if (GetLastError () != ERROR_INVALID_HANDLE)
|
if (GetLastError () != ERROR_INVALID_HANDLE)
|
||||||
panic ("wait in msleep (%s) failed, %E", wmesg);
|
panic ("wait in msleep (%s) failed, %lu", wmesg, GetLastError ());
|
||||||
debug ("wait in msleep (%s) failed for %d, %E", wmesg,
|
debug ("wait in msleep (%s) failed for %d, %lu", wmesg,
|
||||||
td->td_proc->winpid);
|
td->td_proc->winpid, GetLastError ());
|
||||||
ret = EIDRM;
|
ret = EIDRM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -875,7 +875,7 @@ semget(struct thread *td, struct semget_args *uap)
|
||||||
struct ucred *cred = td->td_ucred;
|
struct ucred *cred = td->td_ucred;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DPRINTF(("semget(0x%X, %d, 0%o)\n", key, nsems, semflg));
|
DPRINTF(("semget(0x%llx, %d, 0%o)\n", key, nsems, semflg));
|
||||||
if (!jail_sysvipc_allowed && jailed(td->td_ucred))
|
if (!jail_sysvipc_allowed && jailed(td->td_ucred))
|
||||||
return (ENOSYS);
|
return (ENOSYS);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue