diff --git a/attach.c b/attach.c index 22d7a93..63e21c6 100644 --- a/attach.c +++ b/attach.c @@ -93,7 +93,7 @@ int *get_child_tty_fds(struct ptrace_child *child, int statfd, int *count) { if ((child->error = parse_proc_stat(statfd, &child_status))) return NULL; - debug("Resolved child tty: %u", child_status.ctty); + debug("Resolved child tty: %x", (unsigned)child_status.ctty); if (stat("/dev/tty", &tty_st) < 0) { child->error = errno; @@ -169,7 +169,7 @@ int do_setsid(struct ptrace_child *child) { if (err < 0) return err; - debug("Forked a child: %d", child->forked_pid); + debug("Forked a child: %ld", child->forked_pid); err = ptrace_finish_attach(&dummy, child->forked_pid); if (err < 0) diff --git a/reptyr.h b/reptyr.h index f2fc29e..0fbd48b 100644 --- a/reptyr.h +++ b/reptyr.h @@ -23,6 +23,7 @@ #define REPTYR_VERSION "0.2dev" int attach_child(pid_t pid, const char *pty, int force_stdio); -void die(const char *msg, ...); -void debug(const char *msg, ...); -void error(const char *msg, ...); +#define __printf __attribute__((format(printf, 1, 2))) +void __printf die(const char *msg, ...); +void __printf debug(const char *msg, ...); +void __printf error(const char *msg, ...);