2002-09-30 Christopher Faylor <cgf@redhat.com>
+ Remove \n from calls to strace class printfs throughout.
+
+2002-09-30 Christopher Faylor <cgf@redhat.com>
+
* exceptions.cc (unused_sig_wrapper): Accommodate newer compilers.
2002-09-29 Christopher Faylor <cgf@redhat.com>
char **av = argv + n;
while (*gv)
{
- debug_printf ("argv[%d] = '%s'\n", n++, *gv);
+ debug_printf ("argv[%d] = '%s'", n++, *gv);
*av++ = *gv++;
}
/* 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;
}
}
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))
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 ();
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;
}
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);
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;
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;
}
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);
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;
}
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;
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;
{
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;
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;
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;
break;
default:
- debug_printf ("/dev/dsp: ioctl not handled yet! FIXME:\n");
+ debug_printf ("/dev/dsp: ioctl not handled yet! FIXME:");
break;
#undef CASE
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;
}
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;
ifr = (struct ifreq *) p;
if (ifr == 0)
{
- debug_printf ("ifr == NULL\n");
+ debug_printf ("ifr == NULL");
set_errno (EINVAL);
return -1;
}
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)
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);
if (is_rewind_device ())
{
- debug_printf ("rewinding\n");
+ debug_printf ("rewinding");
op.mt_op = MTREW;
ioctl (MTIOCTOP, &op);
}
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;
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;
}
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,
}
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
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)
{
return -1;
}
}
- debug_printf ("name %s\n", name);
+ debug_printf ("name %s", name);
h_errno = 0;
return 0;
}
break;
else if (res != ERROR_SUCCESS)
{
- debug_printf ("RegEnumKeyEx failed, error %d!\n", res);
+ debug_printf ("RegEnumKeyEx failed, error %d!", res);
break;
}
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);
/* 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
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;
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;
}
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;
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;
}
{
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)
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;
}
RevertToSelf ();
}
if (!OpenProcessToken (hMainProc, TOKEN_ADJUST_DEFAULT, &ptok))
- debug_printf ("OpenProcessToken(): %E\n");
+ debug_printf ("OpenProcessToken(): %E");
else
{
if (!SetTokenInformation (ptok, TokenPrimaryGroup,
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;
}
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)))