* defs.h: Declare tprints().
* strace.c: Define tprints().
(tabto): Use tprints(str), since tprintf(str) was throwing a warning.
* desc.c: Use tprints(str) instead of tprintf("%s", str).
* file.c: Likewise.
* io.c: Likewise.
* net.c: Likewise.
* process.c: Likewise.
* signal.c: Likewise.
* syscall.c: Likewise.
* util.c: Likewise.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
printtv_bitness((tcp), (addr), BITNESS_CURRENT, 1)
extern void tprintf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+extern void tprints(const char *str);
#ifndef HAVE_STRERROR
const char *strerror(int);
tprintf(", [");
for (j = 0, sep = ""; j < nfds; j++) {
if (FD_ISSET(j, fds)) {
- tprintf("%s", sep);
+ tprints(sep);
printfd(tcp, j);
sep = " ";
}
void
tprint_open_modes(mode_t flags)
{
- tprintf("%s", sprint_open_modes(flags) + sizeof("flags"));
+ tprints(sprint_open_modes(flags) + sizeof("flags"));
}
static int
tprintf(", ");
iop = ioctl_lookup(tcp->u_arg[1]);
if (iop) {
- tprintf("%s", iop->symbol);
+ tprints(iop->symbol);
while ((iop = ioctl_next_match(iop)))
tprintf(" or %s", iop->symbol);
} else
const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK);
if (str) {
- tprintf("%s", str);
+ tprints(str);
flags &= ~SOCK_TYPE_MASK;
if (!flags)
return;
cp.p64 = cp.p32;
if (cp.p64 == 0)
break;
- tprintf("%s", sep);
+ tprints(sep);
printstr(tcp, cp.p64, -1);
addr += personality_wordsize[current_personality];
}
static void
printsigmask(sigset_t *mask, int rt)
{
- tprintf("%s", sprintsigmask("", mask, rt));
+ tprints(sprintsigmask("", mask, rt));
}
void
printsignal(int nr)
{
- tprintf("%s", signame(nr));
+ tprints(signame(nr));
}
void
curcol += n;
}
va_end(args);
- return;
+}
+
+void
+tprints(const char *str)
+{
+ if (outf) {
+ int n = fputs(str, outf);
+ if (n >= 0) {
+ curcol += strlen(str);
+ return;
+ }
+ if (outf != stderr)
+ perror(outfname == NULL
+ ? "<writing to pipe>" : outfname);
+ }
}
void
tabto(void)
{
if (curcol < acolumn)
- tprintf(acolumn_spaces + curcol);
+ tprints(acolumn_spaces + curcol);
}
void
return 0;
}
nargs = sysent[scno].nargs;
- tprintf("%s", sysent[scno].sys_name);
+ tprints(sysent[scno].sys_name);
for (i = 0; i < nargs; i++)
tprintf(", %#lx", tcp->u_arg[i+1]);
}
const char *str = xlookup(xlat, val);
if (str)
- tprintf("%s", str);
+ tprints(str);
else
tprintf("%#x /* %s */", val, dflt);
}
const char *sep;
if (flags == 0 && xlat->val == 0) {
- tprintf("%s", xlat->str);
+ tprints(xlat->str);
return 1;
}
void
printuid(const char *text, unsigned long uid)
{
- tprintf("%s", text);
- tprintf((uid == -1) ? "%ld" : "%lu", uid);
+ tprintf((uid == -1) ? "%s%ld" : "%s%lu", text, uid);
}
static char path[MAXPATHLEN + 1];