whitespace cleanup
This commit is contained in:
parent
00caa48b91
commit
46f5dd5958
|
@ -61,7 +61,7 @@ _cygtls::call2 (DWORD (*func) (void *, void *), void *arg, void *buf)
|
|||
|
||||
/* Optional BLODA detection. The idea is that the function address is
|
||||
supposed to be within Cygwin itself. This is also true for pthreads,
|
||||
since pthreads are always calling thread_wrapper in miscfuncs.cc.
|
||||
since pthreads are always calling thread_wrapper in miscfuncs.cc.
|
||||
Therefore, every function call to a function outside of the Cygwin DLL
|
||||
is potentially a thread injected into the Cygwin process by some BLODA.
|
||||
|
||||
|
|
|
@ -132,10 +132,10 @@ dll::init ()
|
|||
following fix: Check if the path is preceeded by a long pathname prefix,
|
||||
and, if so, drop it forthwith so that subsequent full path comparisons
|
||||
work as expected.
|
||||
|
||||
|
||||
At least that was the original idea. In fact there are two case, linked
|
||||
and runtime loaded DLLs, which have to be distinguished:
|
||||
|
||||
|
||||
- Linked DLLs are loaded by only specifying the basename of the DLL and
|
||||
searching it using the system DLL search order as given in the
|
||||
aforementioned MSDN URL.
|
||||
|
|
|
@ -1222,7 +1222,7 @@ fhandler_base_overlapped::close ()
|
|||
else
|
||||
{
|
||||
/* Cancelling seems to be necessary for cases where a reader is
|
||||
still executing when a signal handler performs a close. */
|
||||
still executing when a signal handler performs a close. */
|
||||
if (!writer)
|
||||
CancelIo (get_io_handle ());
|
||||
destroy_overlapped ();
|
||||
|
|
|
@ -183,7 +183,7 @@ class fhandler_base
|
|||
|
||||
public:
|
||||
long inc_refcnt () {return InterlockedIncrement (&_refcnt);}
|
||||
long dec_refcnt () {return InterlockedDecrement (&_refcnt);}
|
||||
long dec_refcnt () {return InterlockedDecrement (&_refcnt);}
|
||||
class fhandler_base *archetype;
|
||||
int usecount;
|
||||
|
||||
|
|
|
@ -591,7 +591,7 @@ fhandler_console::read (void *pv, size_t& buflen)
|
|||
|
||||
if (dev_state.ext_mouse_mode6 /* distinguish release */
|
||||
&& mouse_event.dwButtonState < dev_state.dwLastButtonState)
|
||||
mode6_term = 'm';
|
||||
mode6_term = 'm';
|
||||
|
||||
dev_state.last_button_code = b;
|
||||
|
||||
|
@ -646,7 +646,7 @@ fhandler_console::read (void *pv, size_t& buflen)
|
|||
|
||||
__small_sprintf (tmp, "\033[M%c", b + ' ');
|
||||
nread = 4;
|
||||
/* the neat nested encoding function of mintty
|
||||
/* the neat nested encoding function of mintty
|
||||
does not compile in g++, so let's unfold it: */
|
||||
if (xcode < 0x80)
|
||||
tmp [nread++] = xcode;
|
||||
|
@ -692,9 +692,9 @@ fhandler_console::read (void *pv, size_t& buflen)
|
|||
if (dev_state.use_focus)
|
||||
{
|
||||
if (input_rec.Event.FocusEvent.bSetFocus)
|
||||
__small_sprintf (tmp, "\033[I");
|
||||
__small_sprintf (tmp, "\033[I");
|
||||
else
|
||||
__small_sprintf (tmp, "\033[O");
|
||||
__small_sprintf (tmp, "\033[O");
|
||||
|
||||
toadd = tmp;
|
||||
nread = 3;
|
||||
|
|
|
@ -1205,7 +1205,7 @@ format_process_mountstuff (void *data, char *&destbuf, bool mountinfo)
|
|||
{
|
||||
WCHAR drive[3] = { mnt->mnt_fsname[0], L':', L'\0' };
|
||||
disk_type dt = get_disk_type (drive);
|
||||
|
||||
|
||||
if (dt == DT_SHARE_SMB || dt == DT_SHARE_NFS)
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ static int osi;
|
|||
|
||||
void
|
||||
fhandler_pty_master::flush_to_slave ()
|
||||
{
|
||||
{
|
||||
if (get_readahead_valid () && !(get_ttyp ()->ti.c_lflag & ICANON))
|
||||
accept_input ();
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ class lockf_t
|
|||
uint16_t lf_type; /* Lock type: F_RDLCK, F_WRLCK */
|
||||
_off64_t lf_start; /* Byte # of the start of the lock */
|
||||
_off64_t lf_end; /* Byte # of the end of the lock (-1=EOF) */
|
||||
int64_t lf_id; /* Cygwin PID for POSIX locks, a unique id per
|
||||
int64_t lf_id; /* Cygwin PID for POSIX locks, a unique id per
|
||||
file table entry for BSD flock locks. */
|
||||
DWORD lf_wid; /* Win PID of the resource holding the lock */
|
||||
uint16_t lf_ver; /* Version number of the lock. If a released
|
||||
|
|
|
@ -178,7 +178,7 @@ static int glob1(Char *, glob_t *, size_t *);
|
|||
static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *);
|
||||
static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *);
|
||||
static int globextend(const Char *, glob_t *, size_t *);
|
||||
static const Char *
|
||||
static const Char *
|
||||
globtilde(const Char *, Char *, size_t, glob_t *);
|
||||
static int globexp1(const Char *, glob_t *, size_t *);
|
||||
static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *);
|
||||
|
@ -399,8 +399,8 @@ globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
|
|||
if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))
|
||||
return pattern;
|
||||
|
||||
/*
|
||||
* Copy up to the end of the string or /
|
||||
/*
|
||||
* Copy up to the end of the string or /
|
||||
*/
|
||||
eb = &patbuf[patbuf_len - 1];
|
||||
for (p = pattern + 1, h = (char *) patbuf;
|
||||
|
|
|
@ -57,7 +57,7 @@ bool allow_glob = true;
|
|||
bool ignore_case_with_glob = false;
|
||||
bool dos_file_warning = true;
|
||||
bool allow_winsymlinks = false;
|
||||
bool reset_com = false;
|
||||
bool reset_com = false;
|
||||
bool pipe_byte = false;
|
||||
bool detect_bloda = false;
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ hook_or_detect_cygwin (const char *name, const void *fn, WORD& subsys, HANDLE h)
|
|||
return NULL;
|
||||
pdfirst = rva (PIMAGE_IMPORT_DESCRIPTOR, map, importRVA - offset);
|
||||
/* ... carefully check the required size to fit the string table into
|
||||
the map as well. Allow NAME_MAX bytes for the DLL name, but don't
|
||||
the map as well. Allow NAME_MAX bytes for the DLL name, but don't
|
||||
go beyond the remainder of the section. */
|
||||
if (importRVAMaxSize - importRVASize > wincap.allocation_granularity ())
|
||||
{
|
||||
|
|
|
@ -516,33 +516,33 @@ thread_wrapper (VOID *arg)
|
|||
}
|
||||
|
||||
__asm__ ("\n\
|
||||
movl %[WRAPPER_ARG], %%ebx # Load &wrapper_arg into ebx \n\
|
||||
movl (%%ebx), %%eax # Load thread func into eax \n\
|
||||
movl 4(%%ebx), %%ecx # Load thread arg into ecx \n\
|
||||
movl 8(%%ebx), %%edx # Load stackaddr into edx \n\
|
||||
movl 12(%%ebx), %%ebx # Load stackbase into ebx \n\
|
||||
subl %[CYGTLS], %%ebx # Subtract CYGTLS_PADSIZE \n\
|
||||
subl $4, %%ebx # Subtract another 4 bytes \n\
|
||||
movl %%ebx, %%esp # Set esp \n\
|
||||
xorl %%ebp, %%ebp # Set ebp to 0 \n\
|
||||
# Make gcc 3.x happy and align the stack so that it is \n\
|
||||
# 16 byte aligned right before the final call opcode. \n\
|
||||
andl $-16, %%esp # 16 byte align \n\
|
||||
addl $-12, %%esp # 12 bytes + 4 byte arg = 16 \n\
|
||||
# Now we moved to the new stack. Save thread func address\n\
|
||||
# and thread arg on new stack \n\
|
||||
pushl %%ecx # Push thread arg onto stack \n\
|
||||
pushl %%eax # Push thread func onto stack \n\
|
||||
# Now it's safe to release the OS stack. \n\
|
||||
pushl $0x8000 # dwFreeType: MEM_RELEASE \n\
|
||||
pushl $0x0 # dwSize: 0 \n\
|
||||
pushl %%edx # lpAddress: stackaddr \n\
|
||||
call _VirtualFree@12 # Shoot \n\
|
||||
# All set. We can pop the thread function address from \n\
|
||||
# the stack and call it. The thread arg is still on the \n\
|
||||
# stack in the expected spot. \n\
|
||||
popl %%eax # Pop thread_func address \n\
|
||||
call *%%eax # Call thread func \n"
|
||||
movl %[WRAPPER_ARG], %%ebx # Load &wrapper_arg into ebx \n\
|
||||
movl (%%ebx), %%eax # Load thread func into eax \n\
|
||||
movl 4(%%ebx), %%ecx # Load thread arg into ecx \n\
|
||||
movl 8(%%ebx), %%edx # Load stackaddr into edx \n\
|
||||
movl 12(%%ebx), %%ebx # Load stackbase into ebx \n\
|
||||
subl %[CYGTLS], %%ebx # Subtract CYGTLS_PADSIZE \n\
|
||||
subl $4, %%ebx # Subtract another 4 bytes \n\
|
||||
movl %%ebx, %%esp # Set esp \n\
|
||||
xorl %%ebp, %%ebp # Set ebp to 0 \n\
|
||||
# Make gcc 3.x happy and align the stack so that it is \n\
|
||||
# 16 byte aligned right before the final call opcode. \n\
|
||||
andl $-16, %%esp # 16 byte align \n\
|
||||
addl $-12, %%esp # 12 bytes + 4 byte arg = 16 \n\
|
||||
# Now we moved to the new stack. Save thread func address \n\
|
||||
# and thread arg on new stack \n\
|
||||
pushl %%ecx # Push thread arg onto stack \n\
|
||||
pushl %%eax # Push thread func onto stack \n\
|
||||
# Now it's safe to release the OS stack. \n\
|
||||
pushl $0x8000 # dwFreeType: MEM_RELEASE \n\
|
||||
pushl $0x0 # dwSize: 0 \n\
|
||||
pushl %%edx # lpAddress: stackaddr \n\
|
||||
call _VirtualFree@12 # Shoot \n\
|
||||
# All set. We can pop the thread function address from \n\
|
||||
# the stack and call it. The thread arg is still on the \n\
|
||||
# stack in the expected spot. \n\
|
||||
popl %%eax # Pop thread_func address \n\
|
||||
call *%%eax # Call thread func \n"
|
||||
: : [WRAPPER_ARG] "r" (&wrapper_arg),
|
||||
[CYGTLS] "i" (CYGTLS_PADSIZE));
|
||||
/* Never return from here. */
|
||||
|
|
|
@ -97,11 +97,11 @@ win32_device_name (const char *src_path, char *win32_path, device& dev)
|
|||
#define SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH 28
|
||||
#pragma pack(push,4)
|
||||
struct smb_extended_info {
|
||||
DWORD samba_magic; /* Always SAMBA_EXTENDED_INFO_MAGIC */
|
||||
DWORD samba_version; /* Major/Minor/Release/Revision */
|
||||
DWORD samba_subversion; /* Prerelease/RC/Vendor patch */
|
||||
DWORD samba_magic; /* Always SAMBA_EXTENDED_INFO_MAGIC */
|
||||
DWORD samba_version; /* Major/Minor/Release/Revision */
|
||||
DWORD samba_subversion; /* Prerelease/RC/Vendor patch */
|
||||
LARGE_INTEGER samba_gitcommitdate;
|
||||
char samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH];
|
||||
char samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ details. */
|
|||
#define USE_SYS_TYPES_FD_SET
|
||||
#define __WSA_ERR_MACROS_DEFINED
|
||||
/* FIXME: Collision with different declarations of if_nametoindex and
|
||||
if_indextoname functions in iphlpapi.h since Vista.
|
||||
if_indextoname functions in iphlpapi.h since Vista.
|
||||
TODO: Convert if_nametoindex to cygwin_if_nametoindex and call
|
||||
system functions on Vista and later. */
|
||||
#define _INC_NETIOAPI
|
||||
|
|
|
@ -892,7 +892,7 @@ is_virtual_symlink:
|
|||
else if (isdev_dev (dev))
|
||||
{
|
||||
/* If we're looking for a file below /dev, which doesn't exist,
|
||||
make sure that the device type is converted to FH_FS, so that
|
||||
make sure that the device type is converted to FH_FS, so that
|
||||
subsequent code handles the file correctly.
|
||||
Unless /dev itself doesn't exist on disk. In that case /dev
|
||||
is handled as virtual filesystem, and virtual filesystems are
|
||||
|
@ -3704,7 +3704,7 @@ find_fast_cwd_pointer ()
|
|||
if (movedi[0] == 0x8b && movedi[1] == 0xff) /* mov edi,edi -> W8 */
|
||||
{
|
||||
/* Windows 8 CP 32 bit (after a Windows Update?) does not call
|
||||
RtlEnterCriticalSection. For some reason the function manipulates
|
||||
RtlEnterCriticalSection. For some reason the function manipulates
|
||||
the FastPebLock manually, kind of like RtlEnterCriticalSection has
|
||||
been converted to an inline function.
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
|
|||
memset (procinfo, 0, sizeof (*procinfo));
|
||||
created = true; /* Lie that we created this - just reuse old
|
||||
shared memory */
|
||||
}
|
||||
}
|
||||
|
||||
if ((procinfo->process_state & PID_REAPED)
|
||||
|| ((procinfo->process_state & PID_INITIALIZING) && (flag & PID_NOREDIR)
|
||||
|
|
|
@ -188,7 +188,7 @@ do_pseudo_reloc (void * start, void * end, void * base)
|
|||
* 1) With a (v2-style) version header. In this case, the
|
||||
* first entry in the list is a 3-DWORD structure, with
|
||||
* value:
|
||||
* { 0, 0, RP_VERSION_V1 }
|
||||
* { 0, 0, RP_VERSION_V1 }
|
||||
* In this case, we skip to the next entry in the list,
|
||||
* knowing that all elements after the head item can
|
||||
* be cast to runtime_pseudo_reloc_item_v1.
|
||||
|
|
|
@ -595,7 +595,7 @@ _recycler_sd (void *buf, bool users, bool dir)
|
|||
{
|
||||
NTSTATUS status;
|
||||
PISECURITY_DESCRIPTOR psd = (PISECURITY_DESCRIPTOR) buf;
|
||||
|
||||
|
||||
if (!psd)
|
||||
return NULL;
|
||||
RtlCreateSecurityDescriptor (psd, SECURITY_DESCRIPTOR_REVISION);
|
||||
|
@ -614,7 +614,7 @@ _recycler_sd (void *buf, bool users, bool dir)
|
|||
dir ? CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE
|
||||
: NO_INHERITANCE,
|
||||
FILE_ALL_ACCESS, well_known_system_sid);
|
||||
if (users)
|
||||
if (users)
|
||||
RtlAddAccessAllowedAceEx (dacl, ACL_REVISION, NO_PROPAGATE_INHERIT_ACE,
|
||||
FILE_GENERIC_READ | FILE_GENERIC_EXECUTE
|
||||
| FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* smallprint.cc: small print routines for WIN32
|
||||
|
||||
Copyright 1996, 1998, 2000, 2001, 2002, 2003, 2005, 2006,
|
||||
2007, 2008, 2009, 2012
|
||||
2007, 2008, 2009, 2012
|
||||
Red Hat, Inc.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
@ -147,15 +147,15 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
|
|||
continue;
|
||||
case 'c':
|
||||
{
|
||||
unsigned char c = (va_arg (ap, int) & 0xff);
|
||||
unsigned char c = (va_arg (ap, int) & 0xff);
|
||||
if (isprint (c) || pad != '0')
|
||||
*dst++ = c;
|
||||
else
|
||||
{
|
||||
*dst++ = '0';
|
||||
*dst++ = 'x';
|
||||
dst = __rn (dst, 16, 0, c, len, pad, LMASK);
|
||||
}
|
||||
{
|
||||
*dst++ = '0';
|
||||
*dst++ = 'x';
|
||||
dst = __rn (dst, 16, 0, c, len, pad, LMASK);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'C':
|
||||
|
|
|
@ -465,7 +465,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
|
|||
PCA service. However, a process which is controlled by PCA is part
|
||||
of a compatibility job, which allows child processes to break away
|
||||
from the job. This helps to avoid this issue.
|
||||
|
||||
|
||||
(*) Note that this is not mintty's fault. It has just been observed
|
||||
with mintty in the first place. See the archives for more info:
|
||||
http://cygwin.com/ml/cygwin-developers/2012-02/msg00018.html */
|
||||
|
@ -746,7 +746,7 @@ loop:
|
|||
/* Reset handle inheritance to default when the execution of a non-Cygwin
|
||||
process fails. Only need to do this for _P_OVERLAY since the handle will
|
||||
be closed otherwise. Don't need to do this for 'parent' since it will
|
||||
be closed in every case. See FIXME above. */
|
||||
be closed in every case. See FIXME above. */
|
||||
if (!iscygwin () && mode == _P_OVERLAY)
|
||||
SetHandleInformation (wr_proc_pipe, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
|
||||
if (wr_proc_pipe == my_wr_proc_pipe)
|
||||
|
|
|
@ -731,8 +731,8 @@ unlink_nt (path_conv &pc)
|
|||
debug_printf ("Sharing violation when opening %S",
|
||||
pc.get_nt_native_path ());
|
||||
/* We never call try_to_bin on NFS and NetApp for the follwing reasons:
|
||||
|
||||
NFS implements its own mechanism to remove in-use files, which looks
|
||||
|
||||
NFS implements its own mechanism to remove in-use files, which looks
|
||||
quite similar to what we do in try_to_bin for remote files.
|
||||
|
||||
Netapp filesystems don't understand the "move and delete" method
|
||||
|
|
|
@ -575,13 +575,13 @@ pthread::cancel ()
|
|||
GetThreadContext (win32_obj_id, &context);
|
||||
/* The OS is not foolproof in terms of asynchronous thread cancellation
|
||||
and tends to hang infinitely if we change the instruction pointer.
|
||||
So just don't cancel asynchronously if the thread is currently
|
||||
So just don't cancel asynchronously if the thread is currently
|
||||
executing Windows code. Rely on deferred cancellation in this case. */
|
||||
if (!cygtls->inside_kernel (&context))
|
||||
{
|
||||
context.Eip = (DWORD) pthread::static_cancel_self;
|
||||
SetThreadContext (win32_obj_id, &context);
|
||||
}
|
||||
{
|
||||
context.Eip = (DWORD) pthread::static_cancel_self;
|
||||
SetThreadContext (win32_obj_id, &context);
|
||||
}
|
||||
}
|
||||
mutex.unlock ();
|
||||
/* See above. For instance, a thread which waits for a semaphore in sem_wait
|
||||
|
|
Loading…
Reference in New Issue