From 13fa2550e34504b6543648f2129f3b25efec745b Mon Sep 17 00:00:00 2001 From: crass Date: Sat, 1 Sep 2018 05:18:13 -0500 Subject: [PATCH] Make all PDEBUG calls print the PID, helpful for multiprocess applications. --- src/debug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug.h b/src/debug.h index b9b5215..6688c7c 100644 --- a/src/debug.h +++ b/src/debug.h @@ -3,8 +3,8 @@ #ifdef DEBUG # include -# define PSTDERR(fmt, args...) do { dprintf(2,fmt, ## args); } while(0) -# define PDEBUG(fmt, args...) PSTDERR("DEBUG:"fmt, ## args) +# define PSTDERR(fmt, args...) do { dprintf(2,fmt, getpid(), ## args); } while(0) +# define PDEBUG(fmt, args...) PSTDERR("DEBUG:pid[%d]:"fmt, ## args) # define DEBUGDECL(args...) args # include "core.h"