From 8eac088ce170552de8a253d5adf0d7d02f2c8fea Mon Sep 17 00:00:00 2001 From: cgf Date: Mon, 30 Sep 2002 04:35:17 +0000 Subject: [PATCH] Remove \n from calls to strace class printfs throughout. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/dcrt0.cc | 6 +++--- winsup/cygwin/dll_init.cc | 2 +- winsup/cygwin/exceptions.cc | 2 +- winsup/cygwin/fhandler_clipboard.cc | 16 ++++++++-------- winsup/cygwin/fhandler_dsp.cc | 8 ++++---- winsup/cygwin/fhandler_serial.cc | 2 +- winsup/cygwin/fhandler_socket.cc | 10 +++++----- winsup/cygwin/fhandler_tape.cc | 10 +++++----- winsup/cygwin/fork.cc | 2 +- winsup/cygwin/ioctl.cc | 2 +- winsup/cygwin/net.cc | 2 +- winsup/cygwin/path.cc | 2 +- winsup/cygwin/security.cc | 12 ++++++------ winsup/cygwin/syscalls.cc | 20 ++++++++++---------- winsup/cygwin/times.cc | 2 +- winsup/cygwin/uinfo.cc | 2 +- 17 files changed, 54 insertions(+), 50 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8d8614452c..f1fd014c61 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,9 @@ 2002-09-30 Christopher Faylor + Remove \n from calls to strace class printfs throughout. + +2002-09-30 Christopher Faylor + * exceptions.cc (unused_sig_wrapper): Accommodate newer compilers. 2002-09-29 Christopher Faylor diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 58fb823a09..1ed3c7f147 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -333,7 +333,7 @@ globify (char *word, char **&argv, int &argc, int &argvlen) char **av = argv + n; while (*gv) { - debug_printf ("argv[%d] = '%s'\n", n++, *gv); + debug_printf ("argv[%d] = '%s'", n++, *gv); *av++ = *gv++; } @@ -403,7 +403,7 @@ build_argv (char *cmd, char **&argv, int &argc, int winshell) /* Add word to argv file after (optional) wildcard expansion. */ if (!winshell || !argc || !globify (word, argv, argc, argvlen)) { - debug_printf ("argv[%d] = '%s'\n", argc, word); + debug_printf ("argv[%d] = '%s'", argc, word); argv[argc++] = word; } } @@ -793,7 +793,7 @@ initial_env () DWORD ms = atoi (buf); buf[0] = '\0'; len = GetModuleFileName (NULL, buf, MAX_PATH); - console_printf ("Sleeping %d, pid %u %s\n", ms, GetCurrentProcessId (), buf); + console_printf ("Sleeping %d, pid %u %s", ms, GetCurrentProcessId (), buf); Sleep (ms); } if (GetEnvironmentVariable ("CYGWIN_DEBUG", buf, sizeof (buf) - 1)) diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index 51441ab398..ea4265ee5a 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -188,7 +188,7 @@ dll_list::detach (dll *d) return; if (d->count <= 0) - system_printf ("WARNING: try to detach an already detached dll ...\n"); + system_printf ("WARNING: try to detach an already detached dll ..."); else if (--d->count == 0) { d->p.run_dtors (); diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 54c5d59e08..fa8cd634b4 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -765,7 +765,7 @@ interrupt_on_return (sigthread *th, int sig, void *handler, struct sigaction& si return 1; } - sigproc_printf ("couldn't find a stack frame, i %d\n", i); + sigproc_printf ("couldn't find a stack frame, i %d", i); return 0; } diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc index ce14def203..aeb5933dca 100644 --- a/winsup/cygwin/fhandler_clipboard.cc +++ b/winsup/cygwin/fhandler_clipboard.cc @@ -88,7 +88,7 @@ set_clipboard (const void *buf, size_t len) hmem = GlobalAlloc (GMEM_MOVEABLE, len + sizeof (size_t)); if (!hmem) { - system_printf ("Couldn't allocate global buffer for write\n"); + system_printf ("Couldn't allocate global buffer for write"); return -1; } clipbuf = (unsigned char *) GlobalLock (hmem); @@ -101,7 +101,7 @@ set_clipboard (const void *buf, size_t len) if (!SetClipboardData (cygnativeformat, hmem)) { system_printf - ("Couldn't write native format to the clipboard %04x %x\n", + ("Couldn't write native format to the clipboard %04x %x", cygnativeformat, hmem); /* FIXME: return an appriate error code &| set_errno(); */ return -1; @@ -110,7 +110,7 @@ set_clipboard (const void *buf, size_t len) if (GlobalFree (hmem)) { system_printf - ("Couldn't free global buffer after write to the clipboard\n"); + ("Couldn't free global buffer after write to the clipboard"); /* FIXME: return an appriate error code &| set_errno(); */ return 0; } @@ -121,7 +121,7 @@ set_clipboard (const void *buf, size_t len) hmem = GlobalAlloc (GMEM_MOVEABLE, len + 2); if (!hmem) { - system_printf ("Couldn't allocate global buffer for write\n"); + system_printf ("Couldn't allocate global buffer for write"); return -1; } clipbuf = (unsigned char *) GlobalLock (hmem); @@ -132,7 +132,7 @@ set_clipboard (const void *buf, size_t len) if (!SetClipboardData ((current_codepage == ansi_cp ? CF_TEXT : CF_OEMTEXT), hmem)) { - system_printf ("Couldn't write to the clipboard\n"); + system_printf ("Couldn't write to the clipboard"); /* FIXME: return an appriate error code &| set_errno(); */ return -1; } @@ -140,7 +140,7 @@ set_clipboard (const void *buf, size_t len) if (GlobalFree (hmem)) { system_printf - ("Couldn't free global buffer after write to the clipboard\n"); + ("Couldn't free global buffer after write to the clipboard"); /* FIXME: return an appriate error code &| set_errno(); */ } return 0; @@ -157,7 +157,7 @@ fhandler_dev_clipboard::write (const void *buf, size_t len) void *tempbuffer = realloc (membuffer, cursize + len); if (!tempbuffer) { - system_printf ("Couldn't realloc() clipboard buffer for write\n"); + system_printf ("Couldn't realloc() clipboard buffer for write"); return -1; } membuffer = tempbuffer; @@ -235,7 +235,7 @@ fhandler_dev_clipboard::read (void *ptr, size_t len) { CloseClipboard (); #if 0 - system_printf ("a non-accepted format! %d\n", format); + system_printf ("a non-accepted format! %d", format); #endif set_errno (0); return 0; diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc index fad4319004..063e791265 100644 --- a/winsup/cygwin/fhandler_dsp.cc +++ b/winsup/cygwin/fhandler_dsp.cc @@ -93,12 +93,12 @@ Audio::open (int rate, int bits, int channels, bool bCallback) nBytesWritten_ = 0L; bufferIndex_ = 0; buffer_ = 0L; - debug_printf ("number devices %d\n", nDevices); + debug_printf ("number devices %d", nDevices); if (nDevices <= 0) return false; debug_printf ("trying to map device freq %d, bits %d, " - "channels %d, callback %d\n", rate, bits, channels, + "channels %d, callback %d", rate, bits, channels, bCallback); int bytesperSample = bits / 8; @@ -519,7 +519,7 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *ptr) int *intptr = (int *) ptr; switch (cmd) { -#define CASE(a) case a : debug_printf("/dev/dsp: ioctl %s\n", #a); +#define CASE(a) case a : debug_printf("/dev/dsp: ioctl %s", #a); CASE (SNDCTL_DSP_RESET) audioformat_ = AFMT_S8; @@ -624,7 +624,7 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *ptr) break; default: - debug_printf ("/dev/dsp: ioctl not handled yet! FIXME:\n"); + debug_printf ("/dev/dsp: ioctl not handled yet! FIXME:"); break; #undef CASE diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc index 748eb4b283..e2d8f67ac3 100644 --- a/winsup/cygwin/fhandler_serial.cc +++ b/winsup/cygwin/fhandler_serial.cc @@ -765,7 +765,7 @@ fhandler_serial::tcsetattr (int action, const struct termios *t) vmin_ = t->c_cc[VMIN]; } - debug_printf ("vtime %d, vmin %d\n", vtime_, vmin_); + debug_printf ("vtime %d, vmin %d", vtime_, vmin_); if (ovmin == vmin_ && ovtime == vtime_) return 0; diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 95633e4b57..7d7e984f3c 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -1104,7 +1104,7 @@ fhandler_socket::ioctl (unsigned int cmd, void *p) } res = get_ifconf (ifcp, cmd); if (res) - debug_printf ("error in get_ifconf\n"); + debug_printf ("error in get_ifconf"); break; case SIOCGIFFLAGS: ifr = (struct ifreq *) p; @@ -1134,7 +1134,7 @@ fhandler_socket::ioctl (unsigned int cmd, void *p) ifr = (struct ifreq *) p; if (ifr == 0) { - debug_printf ("ifr == NULL\n"); + debug_printf ("ifr == NULL"); set_errno (EINVAL); return -1; } @@ -1142,16 +1142,16 @@ fhandler_socket::ioctl (unsigned int cmd, void *p) res = get_ifconf (&ifc, cmd); if (res) { - debug_printf ("error in get_ifconf\n"); + debug_printf ("error in get_ifconf"); break; } - debug_printf (" name: %s\n", ifr->ifr_name); + debug_printf (" name: %s", ifr->ifr_name); for (ifrp = ifc.ifc_req; (caddr_t) ifrp < ifc.ifc_buf + ifc.ifc_len; ++ifrp) { - debug_printf ("testname: %s\n", ifrp->ifr_name); + debug_printf ("testname: %s", ifrp->ifr_name); if (! strcmp (ifrp->ifr_name, ifr->ifr_name)) { switch (cmd) diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc index f5bb333bc6..c99a0190a4 100644 --- a/winsup/cygwin/fhandler_tape.cc +++ b/winsup/cygwin/fhandler_tape.cc @@ -119,7 +119,7 @@ fhandler_dev_tape::close (void) if ((has_written) && (! eom_detected)) { /* if last operation was writing, write a filemark */ - debug_printf ("writing filemark\n"); + debug_printf ("writing filemark"); op.mt_op = MTWEOF; op.mt_count = 1; ioctl (MTIOCTOP, &op); @@ -131,7 +131,7 @@ fhandler_dev_tape::close (void) if (is_rewind_device ()) { - debug_printf ("rewinding\n"); + debug_printf ("rewinding"); op.mt_op = MTREW; ioctl (MTIOCTOP, &op); } @@ -167,7 +167,7 @@ fhandler_dev_tape::lseek (__off64_t offset, int whence) struct mtop op; struct mtpos pos; - debug_printf ("lseek (%s, %d, %d)\n", get_name (), offset, whence); + debug_printf ("lseek (%s, %d, %d)", get_name (), offset, whence); writebuf (); eom_detected = eof_detected = 0; @@ -444,7 +444,7 @@ static int tape_error (DWORD lasterr, const char *txt) { if (lasterr) - debug_printf ("%s: error: %d\n", txt, lasterr); + debug_printf ("%s: error: %d", txt, lasterr); return lasterr; } @@ -452,7 +452,7 @@ tape_error (DWORD lasterr, const char *txt) int fhandler_dev_tape::tape_write_marks (int marktype, DWORD len) { - syscall_printf ("write_tapemark\n"); + syscall_printf ("write_tapemark"); while (((lasterr = WriteTapemark (get_handle (), marktype, len, diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index daca121091..e2683df1f4 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -245,7 +245,7 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls) } sync_with_parent ("after longjmp.", TRUE); - sigproc_printf ("hParent %p, child 1 first_dll %p, load_dlls %d\n", hParent, + sigproc_printf ("hParent %p, child 1 first_dll %p, load_dlls %d", hParent, first_dll, load_dlls); #ifdef DEBUGGING diff --git a/winsup/cygwin/ioctl.cc b/winsup/cygwin/ioctl.cc index 6b12a2ec37..17062eec7f 100644 --- a/winsup/cygwin/ioctl.cc +++ b/winsup/cygwin/ioctl.cc @@ -38,7 +38,7 @@ ioctl (int fd, int cmd, ...) char *argp = va_arg (ap, char *); va_end (ap); - debug_printf ("fd %d, cmd %x\n", fd, cmd); + debug_printf ("fd %d, cmd %x", fd, cmd); if (cfd->is_tty () && cfd->get_device () != FH_PTYM) switch (cmd) { diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index ecf0cdf459..123119ddc4 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -879,7 +879,7 @@ cygwin_gethostname (char *name, size_t len) return -1; } } - debug_printf ("name %s\n", name); + debug_printf ("name %s", name); h_errno = 0; return 0; } diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 22ac83a635..405b72a4a7 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1810,7 +1810,7 @@ mount_info::read_mounts (reg_key& r) break; else if (res != ERROR_SUCCESS) { - debug_printf ("RegEnumKeyEx failed, error %d!\n", res); + debug_printf ("RegEnumKeyEx failed, error %d!", res); break; } diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 49eb82916a..262d2aaff7 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -754,11 +754,11 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, BOOL *pintern) if (!GetTokenInformation (token, TokenGroups, NULL, 0, &size) && GetLastError () != ERROR_INSUFFICIENT_BUFFER) - debug_printf ("GetTokenInformation(token, TokenGroups): %E\n"); + debug_printf ("GetTokenInformation(token, TokenGroups): %E"); else if (!(my_grps = (PTOKEN_GROUPS) malloc (size))) debug_printf ("malloc (my_grps) failed."); else if (!GetTokenInformation (token, TokenGroups, my_grps, size, &size)) - debug_printf ("GetTokenInformation(my_token, TokenGroups): %E\n"); + debug_printf ("GetTokenInformation(my_token, TokenGroups): %E"); else if (!groups.issetgroups ()) /* setgroups was never called */ { ret = sid_in_token_groups (my_grps, groups.pgsid); @@ -855,7 +855,7 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw) /* Retrieve authentication id and group list from own process. */ if (!OpenProcessToken (hMainProc, TOKEN_QUERY, &my_token)) - debug_printf ("OpenProcessToken(my_token): %E\n"); + debug_printf ("OpenProcessToken(my_token): %E"); else { /* Switching user context to SYSTEM doesn't inherit the authentication @@ -864,7 +864,7 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw) if (!GetTokenInformation (my_token, TokenStatistics, &stats, sizeof stats, &size)) debug_printf - ("GetTokenInformation(my_token, TokenStatistics): %E\n"); + ("GetTokenInformation(my_token, TokenStatistics): %E"); else auth_luid = stats.AuthenticationId; @@ -872,13 +872,13 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw) some important well known group sids. */ if (!GetTokenInformation (my_token, TokenGroups, NULL, 0, &size) && GetLastError () != ERROR_INSUFFICIENT_BUFFER) - debug_printf ("GetTokenInformation(my_token, TokenGroups): %E\n"); + debug_printf ("GetTokenInformation(my_token, TokenGroups): %E"); else if (!(my_tok_gsids = (PTOKEN_GROUPS) malloc (size))) debug_printf ("malloc (my_tok_gsids) failed."); else if (!GetTokenInformation (my_token, TokenGroups, my_tok_gsids, size, &size)) { - debug_printf ("GetTokenInformation(my_token, TokenGroups): %E\n"); + debug_printf ("GetTokenInformation(my_token, TokenGroups): %E"); free (my_tok_gsids); my_tok_gsids = NULL; } diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 167e9c0f9e..a2c813c9e1 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -379,7 +379,7 @@ readv (int fd, const struct iovec *const iov, const int iovcnt) fd, iov, iovcnt, wait ? "" : "non", sigcatchers); if (wait && (!cfd->is_slow () || cfd->get_r_no_interrupt ())) - debug_printf ("no need to call ready_for_read\n"); + debug_printf ("no need to call ready_for_read"); else if (!cfd->ready_for_read (fd, wait)) { res = -1; @@ -1576,33 +1576,33 @@ ctermid (char *str) extern "C" int _cygwin_istext_for_stdio (int fd) { - syscall_printf ("_cygwin_istext_for_stdio (%d)\n", fd); + syscall_printf ("_cygwin_istext_for_stdio (%d)", fd); if (CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING) { - syscall_printf (" _cifs: old API\n"); + syscall_printf (" _cifs: old API"); return 0; /* we do it for old apps, due to getc/putc macros */ } cygheap_fdget cfd (fd, false, false); if (cfd < 0) { - syscall_printf (" _cifs: fd not open\n"); + syscall_printf (" _cifs: fd not open"); return 0; } if (cfd->get_device () != FH_DISK) { - syscall_printf (" _cifs: fd not disk file\n"); + syscall_printf (" _cifs: fd not disk file"); return 0; } if (cfd->get_w_binary () || cfd->get_r_binary ()) { - syscall_printf (" _cifs: get_*_binary\n"); + syscall_printf (" _cifs: get_*_binary"); return 0; } - syscall_printf ("_cygwin_istext_for_stdio says yes\n"); + syscall_printf ("_cygwin_istext_for_stdio says yes"); return 1; } @@ -1617,7 +1617,7 @@ setmode_helper (FILE *f) { if (fileno (f) != setmode_file) return 0; - syscall_printf ("setmode: file was %s now %s\n", + syscall_printf ("setmode: file was %s now %s", f->_flags & __SCLE ? "text" : "raw", setmode_mode & O_TEXT ? "text" : "raw"); if (setmode_mode & O_TEXT) @@ -1677,7 +1677,7 @@ setmode (int fd, int mode) setmode_file = fd; _fwalk (_REENT, setmode_helper); - syscall_printf ("setmode (%d<%s>, %p) returns %s\n", fd, cfd->get_name (), + syscall_printf ("setmode (%d<%s>, %p) returns %s", fd, cfd->get_name (), mode, res & O_TEXT ? "text" : "binary"); return res; } @@ -2155,7 +2155,7 @@ setegid32 (__gid32_t gid) RevertToSelf (); } if (!OpenProcessToken (hMainProc, TOKEN_ADJUST_DEFAULT, &ptok)) - debug_printf ("OpenProcessToken(): %E\n"); + debug_printf ("OpenProcessToken(): %E"); else { if (!SetTokenInformation (ptok, TokenPrimaryGroup, diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc index 635d892687..06a98dde4f 100644 --- a/winsup/cygwin/times.cc +++ b/winsup/cygwin/times.cc @@ -40,7 +40,7 @@ __to_clock_t (FILETIME * src, int flag) total -= FACTOR; total /= (unsigned long long) (NSPERSEC / CLOCKS_PER_SEC); - syscall_printf ("total %08x %08x\n", (unsigned)(total>>32), (unsigned)(total)); + syscall_printf ("total %08x %08x", (unsigned)(total>>32), (unsigned)(total)); return total; } diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index fc8b73cc62..8d0baf67ce 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -46,7 +46,7 @@ internal_getlogin (cygheap_user &user) store it in user.psid */ if (!OpenProcessToken (hMainProc, TOKEN_ADJUST_DEFAULT | TOKEN_QUERY, &ptok)) - system_printf ("OpenProcessToken(): %E\n"); + system_printf ("OpenProcessToken(): %E"); else if (!GetTokenInformation (ptok, TokenUser, &tu, sizeof tu, &siz)) system_printf ("GetTokenInformation (TokenUser): %E"); else if (!(ret = user.set_sid (tu))) -- 2.11.0