From de9e39f7012690ef204f5660d8bb47970872d05a Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 14 Sep 2003 01:58:03 +0000 Subject: [PATCH] * Makefile.in: Make malloc_wrapper -fomit-frame-pointer. * cygwin.din: Remove extraneous mallinfo definition. * dcrt0.cc (quoted): Use strechr for efficiency. * fhandler.cc (fhandler_base::write): Correctly use get_output_handle rather than get_handle. (fhandler_base::lseek): Use method for accessing name in debug output. --- winsup/cygwin/ChangeLog | 12 ++++++++++++ winsup/cygwin/Makefile.in | 1 + winsup/cygwin/cygwin.din | 1 - winsup/cygwin/dcrt0.cc | 4 +--- winsup/cygwin/fhandler.cc | 18 +++++++++--------- winsup/cygwin/include/cygwin/version.h | 10 +++++----- 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7a10e0792..915567658 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,15 @@ +2003-09-13 Christopher Faylor + + * Makefile.in: Make malloc_wrapper -fomit-frame-pointer. + + * cygwin.din: Remove extraneous mallinfo definition. + + * dcrt0.cc (quoted): Use strechr for efficiency. + + * fhandler.cc (fhandler_base::write): Correctly use get_output_handle + rather than get_handle. + (fhandler_base::lseek): Use method for accessing name in debug output. + 2003-09-13 Christopher Faylor * fhandler_disk_file.cc (path_conv::ndisk_links): Fix potential diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 785b20744..78851af0c 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -50,6 +50,7 @@ DEFS:=@DEFS@ # cygheap_CFLAGS:=-fomit-frame-pointer malloc_CFLAGS:=-fomit-frame-pointer +malloc_wrapper_CFLAGS:=-fomit-frame-pointer shared_CFLAGS:=-fomit-frame-pointer cygthread_CFLAGS:=-fomit-frame-pointer miscfuncs_CFLAGS:=-fomit-frame-pointer diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din index 1f3575dc6..a61edbdb6 100644 --- a/winsup/cygwin/cygwin.din +++ b/winsup/cygwin/cygwin.din @@ -846,7 +846,6 @@ _lseek = lseek _lseek64 = lseek64 _lstat64 = lstat64 mallinfo -mallinfo malloc _malloc = malloc malloc_stats diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index d5817fb3e..51cc55f25 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -231,10 +231,8 @@ quoted (char *cmd, int winshell) { char *p; strcpy (cmd, cmd + 1); - if ((p = strchr (cmd, quote)) != NULL) + if (*(p = strechr (cmd, quote))) strcpy (p, p + 1); - else - p = strchr (cmd, '\0'); return p; } diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 1310a5ca0..899af388e 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -615,7 +615,7 @@ fhandler_base::write (const void *ptr, size_t len) int res; if (get_append_p ()) - SetFilePointer (get_handle (), 0, 0, FILE_END); + SetFilePointer (get_output_handle (), 0, 0, FILE_END); else if (get_did_lseek ()) { _off64_t actual_length, current_position; @@ -624,10 +624,10 @@ fhandler_base::write (const void *ptr, size_t len) set_did_lseek (0); /* don't do it again */ - actual_length = GetFileSize (get_handle (), &size_high); + actual_length = GetFileSize (get_output_handle (), &size_high); actual_length += ((_off64_t) size_high) << 32; - current_position = SetFilePointer (get_handle (), 0, &pos_high, + current_position = SetFilePointer (get_output_handle (), 0, &pos_high, FILE_CURRENT); current_position += ((_off64_t) pos_high) << 32; @@ -640,7 +640,7 @@ fhandler_base::write (const void *ptr, size_t len) is writing after a long seek beyond EOF, convert the file to a sparse file. */ DWORD dw; - HANDLE h = get_handle (); + HANDLE h = get_output_handle (); BOOL r = DeviceIoControl (h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &dw, NULL); syscall_printf ("%d = DeviceIoControl(%p, FSCTL_SET_SPARSE, " @@ -657,20 +657,20 @@ fhandler_base::write (const void *ptr, size_t len) char zeros[512]; int number_of_zeros_to_write = current_position - actual_length; memset (zeros, 0, 512); - SetFilePointer (get_handle (), 0, NULL, FILE_END); + SetFilePointer (get_output_handle (), 0, NULL, FILE_END); while (number_of_zeros_to_write > 0) { DWORD zeros_this_time = (number_of_zeros_to_write > 512 ? 512 : number_of_zeros_to_write); DWORD written; - if (!WriteFile (get_handle (), zeros, zeros_this_time, + if (!WriteFile (get_output_handle (), zeros, zeros_this_time, &written, NULL)) { __seterrno (); if (get_errno () == EPIPE) raise (SIGPIPE); /* This might fail, but it's the best we can hope for */ - SetFilePointer (get_handle (), current_position, NULL, + SetFilePointer (get_output_handle (), current_position, NULL, FILE_BEGIN); return -1; @@ -679,7 +679,7 @@ fhandler_base::write (const void *ptr, size_t len) { set_errno (ENOSPC); /* This might fail, but it's the best we can hope for */ - SetFilePointer (get_handle (), current_position, NULL, + SetFilePointer (get_output_handle (), current_position, NULL, FILE_BEGIN); return -1; } @@ -886,7 +886,7 @@ fhandler_base::lseek (_off64_t offset, int whence) set_readahead_valid (0); } - debug_printf ("lseek (%s, %D, %d)", unix_path_name, offset, whence); + debug_printf ("lseek (%s, %D, %d)", get_name (), offset, whence); DWORD win32_whence = whence == SEEK_SET ? FILE_BEGIN : (whence == SEEK_CUR ? FILE_CURRENT : FILE_END); diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index c793983fb..6c1c1c8ad 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -191,7 +191,7 @@ details. */ 76: mallinfo 77: thread-safe exit/at_exit 78: Use stat and fstat rather than _stat, and _fstat. - Export btowc and trunc. + Export btowc and trunc. 79: Export acl32 aclcheck32 aclfrommode32 aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32 acltotext32 facl32 fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 ftello64 @@ -202,9 +202,9 @@ details. */ 83: Export gethostid 84: Pty open allocates invisible console. 64 bit interface 85: Export new 32/64 functions from API 0.79 only with leading - underscore. No problems with backward compatibility since no - official release has been made so far. This change removes - exported symbols like fopen64, which might confuse configure. + underscore. No problems with backward compatibility since no + official release has been made so far. This change removes + exported symbols like fopen64, which might confuse configure. 86: Export ftok 87: Export vsyslog 88: Export _getreent @@ -218,7 +218,7 @@ details. */ 93: Export daemon, forkpty, openpty, iruserok, ruserok, login_tty, openpty, forkpty, revoke, logwtmp, updwtmp 94: Export getopt, getopt_long, optarg, opterr, optind, optopt, - optreset, __check_rhosts_file, __rcmd_errstr. + optreset, __check_rhosts_file, __rcmd_errstr. */