diff options
| author | Andreas Schneider <asn@samba.org> | 2014-01-21 09:57:47 +0100 |
|---|---|---|
| committer | Andreas Schneider <asn@samba.org> | 2014-01-21 09:57:47 +0100 |
| commit | b7ec347fca6b11a2297c4d637ec8d8d7b0aebfc6 (patch) | |
| tree | 0bd8cc5d6d6e5cce78bed24dd477511ea0dddff6 /src | |
| parent | e5df09bb2b7aaeef0d3127ad85371eab78702060 (diff) | |
| download | socket_wrapper-b7ec347fca6b11a2297c4d637ec8d8d7b0aebfc6.tar.gz socket_wrapper-b7ec347fca6b11a2297c4d637ec8d8d7b0aebfc6.tar.xz socket_wrapper-b7ec347fca6b11a2297c4d637ec8d8d7b0aebfc6.zip | |
src: Case pid_t to an int in SWRAP_LOG.
Diffstat (limited to 'src')
| -rw-r--r-- | src/socket_wrapper.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 2edc8df..c5b94fb 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -95,14 +95,6 @@ enum swrap_dbglvl_e { #define MIN(a,b) ((a)<(b)?(a):(b)) #endif -#if SIZEOF_PID_T == 8 -# define SPRIpid PRIu64 -#elif SIZEOF_UID_T == 4 -# define SPRIpid PRIu32 -#else -# define SPRIpid "%d" /* Sane default for most platforms */ -#endif /* SIZEOF_UID_T */ - #ifndef ZERO_STRUCT #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) #endif @@ -249,23 +241,23 @@ static void swrap_log(enum swrap_dbglvl_e dbglvl, const char *format, ...) switch (dbglvl) { case SWRAP_LOG_ERROR: fprintf(stderr, - "SWRAP_ERROR("SPRIpid"): %s\n", - getpid(), buffer); + "SWRAP_ERROR(%d): %s\n", + (int)getpid(), buffer); break; case SWRAP_LOG_WARN: fprintf(stderr, - "SWRAP_WARN("SPRIpid"): %s\n", - getpid(), buffer); + "SWRAP_WARN(%d): %s\n", + (int)getpid(), buffer); break; case SWRAP_LOG_DEBUG: fprintf(stderr, - "SWRAP_DEBUG("SPRIpid"): %s\n", - getpid(), buffer); + "SWRAP_DEBUG(%d): %s\n", + (int)getpid(), buffer); break; case SWRAP_LOG_TRACE: fprintf(stderr, - "SWRAP_TRACE("SPRIpid"): %s\n", - getpid(), buffer); + "SWRAP_TRACE(%d): %s\n", + (int)getpid(), buffer); break; } } |
