* cygheap.cc (init_cheap): Rearrange error message.
(cygheap_fixup_in_child): Ditto. * dtable.cc: Remove if 0'ed code. * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode. * sec_helper.cc (cygsid::get_id): Use system_printf for error message. * tty.cc (tty::common_init): Ditto.
This commit is contained in:
parent
66eee32b8f
commit
4558638014
|
@ -1,3 +1,12 @@
|
|||
2002-07-02 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* cygheap.cc (init_cheap): Rearrange error message.
|
||||
(cygheap_fixup_in_child): Ditto.
|
||||
* dtable.cc: Remove if 0'ed code.
|
||||
* fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode.
|
||||
* sec_helper.cc (cygsid::get_id): Use system_printf for error message.
|
||||
* tty.cc (tty::common_init): Ditto.
|
||||
|
||||
2002-07-02 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* net.cc (cygwin_getpeername): Defend against NULL pointer dereference.
|
||||
|
|
|
@ -57,9 +57,9 @@ init_cheap ()
|
|||
MEMORY_BASIC_INFORMATION m;
|
||||
if (!VirtualQuery ((LPCVOID) &_cygheap_start, &m, sizeof m))
|
||||
system_printf ("couldn't get memory info, %E");
|
||||
small_printf ("AllocationBase %p, BaseAddress %p, RegionSize %p, State %p\n",
|
||||
m.AllocationBase, m.BaseAddress, m.RegionSize, m.State);
|
||||
api_fatal ("Couldn't reserve space for cygwin's heap, %E");
|
||||
system_printf ("Couldn't reserve space for cygwin's heap, %E");
|
||||
api_fatal ("AllocationBase %p, BaseAddress %p, RegionSize %p, State %p\n",
|
||||
m.AllocationBase, m.BaseAddress, m.RegionSize, m.State);
|
||||
}
|
||||
cygheap_max = cygheap + 1;
|
||||
}
|
||||
|
@ -125,16 +125,16 @@ cygheap_fixup_in_child (bool execed)
|
|||
DWORD n = (DWORD) cygheap_max - (DWORD) cygheap;
|
||||
/* Reserve cygwin heap in same spot as parent */
|
||||
if (!VirtualAlloc (cygheap, CYGHEAPSIZE, MEM_RESERVE, PAGE_NOACCESS))
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION m;
|
||||
memset (&m, 0, sizeof m);
|
||||
if (!VirtualQuery ((LPCVOID) cygheap, &m, sizeof m))
|
||||
system_printf ("couldn't get memory info, %E");
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION m;
|
||||
memset (&m, 0, sizeof m);
|
||||
if (!VirtualQuery ((LPCVOID) cygheap, &m, sizeof m))
|
||||
system_printf ("couldn't get memory info, %E");
|
||||
|
||||
small_printf ("m.AllocationBase %p, m.BaseAddress %p, m.RegionSize %p, m.State %p\n",
|
||||
m.AllocationBase, m.BaseAddress, m.RegionSize, m.State);
|
||||
api_fatal ("Couldn't reserve space for cygwin's heap (%p <%p>) in child, %E", cygheap, newaddr);
|
||||
}
|
||||
system_printf ("Couldn't reserve space for cygwin's heap (%p <%p>) in child, %E", cygheap, newaddr);
|
||||
api_fatal ("m.AllocationBase %p, m.BaseAddress %p, m.RegionSize %p, m.State %p\n",
|
||||
m.AllocationBase, m.BaseAddress, m.RegionSize, m.State);
|
||||
}
|
||||
|
||||
/* Allocate same amount of memory as parent */
|
||||
if (!VirtualAlloc (cygheap, n, MEM_COMMIT, PAGE_READWRITE))
|
||||
|
|
|
@ -197,8 +197,7 @@ dtable::release (int fd)
|
|||
}
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int
|
||||
extern "C" int
|
||||
cygwin_attach_handle_to_fd (char *name, int fd, HANDLE handle, mode_t bin,
|
||||
DWORD myaccess)
|
||||
{
|
||||
|
@ -691,31 +690,6 @@ dtable::vfork_child_fixup ()
|
|||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static char *
|
||||
handle_to_fn (HANDLE h, char *posix_fn)
|
||||
{
|
||||
IO_STATUS_BLOCK io;
|
||||
FILE_NAME_INFORMATION ntfn;
|
||||
|
||||
io.Status = 0;
|
||||
io.Information = 0;
|
||||
|
||||
SetLastError (0);
|
||||
DWORD res = NtQueryInformationFile (h, &io, &ntfn, sizeof (ntfn), 9);
|
||||
if (res || GetLastError () == ERROR_PROC_NOT_FOUND)
|
||||
{
|
||||
strcpy (posix_fn, "some disk file");
|
||||
return posix_fn;
|
||||
}
|
||||
ntfn.FileName[ntfn.FileNameLength / sizeof (WCHAR)] = 0;
|
||||
|
||||
char win32_fn[MAX_PATH + 100];
|
||||
sys_wcstombs (win32_fn, ntfn.FileName, ntfn.FileNameLength);
|
||||
cygwin_conv_to_full_posix_path (win32_fn, posix_fn);
|
||||
return posix_fn;
|
||||
}
|
||||
#else
|
||||
#define DEVICE_PREFIX "\\device\\"
|
||||
#define DEVICE_PREFIX_LEN sizeof(DEVICE_PREFIX) - 1
|
||||
#define REMOTE "\\Device\\LanmanRedirector\\"
|
||||
|
@ -814,4 +788,3 @@ handle_to_fn (HANDLE h, char *posix_fn)
|
|||
cygwin_conv_to_full_posix_path (w32, posix_fn);
|
||||
return posix_fn;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -438,7 +438,7 @@ fhandler_dev_dsp::open (path_conv *, int flags, mode_t mode)
|
|||
return 0;
|
||||
}
|
||||
|
||||
set_flags (flags & ~O_TEXT, O_BINARY);
|
||||
set_flags ((flags & ~O_TEXT) | O_BINARY);
|
||||
|
||||
if (!s_audio)
|
||||
s_audio = new (audio_buf) Audio;
|
||||
|
|
|
@ -8,6 +8,8 @@ This software is a copyrighted work licensed under the terms of the
|
|||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
/* FIXME: Should this really be fhandler_pipe.cc? */
|
||||
|
||||
#include "winsup.h"
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -149,7 +149,7 @@ cygsid::get_id (BOOL search_grp, int *type)
|
|||
if (!IsValidSid (psid))
|
||||
{
|
||||
__seterrno ();
|
||||
small_printf ("IsValidSid failed with %E");
|
||||
system_printf ("IsValidSid failed with %E");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -402,7 +402,7 @@ tty::common_init (fhandler_pty_master *ptym)
|
|||
if (wincap.has_security () && cygserver_running==CYGSERVER_OK &&
|
||||
(SetKernelObjectSecurity (hMainProc, DACL_SECURITY_INFORMATION,
|
||||
get_null_sd ()) == FALSE))
|
||||
small_printf ("Can't set process security, %E");
|
||||
system_printf ("Can't set process security, %E");
|
||||
|
||||
/* Create synchronisation events */
|
||||
|
||||
|
|
Loading…
Reference in New Issue