Skip to content

Commit

Permalink
MB-6599: Some compilers give warnings about ifdefs in params
Browse files Browse the repository at this point in the history
Change-Id: Ic4ec5000fb575dc2814ae46ee9013e76811e1e2a
Reviewed-on: http://review.couchbase.org/20730
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
  • Loading branch information
trondn committed Sep 11, 2012
1 parent c5a4e2e commit 524945f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions extensions/loggers/file_logger.c
Expand Up @@ -233,16 +233,17 @@ static void logger_log(EXTENSION_LOG_LEVEL severity,
(unsigned int)now.tv_sec, (unsigned int)now.tv_sec,
(unsigned int)now.tv_usec); (unsigned int)now.tv_usec);
} else { } else {
const char *tz;
#ifdef HAVE_TM_ZONE
tz = tval.tm_zone;
#else
tz = tzname[tval.tm_isdst ? 1 : 0];
#endif
/* trim off ' YYYY\n' */ /* trim off ' YYYY\n' */
str[strlen(str) - 6] = '\0'; str[strlen(str) - 6] = '\0';
prefixlen = snprintf(buffer, avail, "%s.%06u %s", prefixlen = snprintf(buffer, avail, "%s.%06u %s",
str, (unsigned int)now.tv_usec, str, (unsigned int)now.tv_usec,
#ifdef HAVE_TM_ZONE tz);
tval.tm_zone
#else
tzname[tval.tm_isdst ? 1 : 0]
#endif
);
} }
} else { } else {
fprintf(stderr, "gettimeofday failed: %s\n", strerror(errno)); fprintf(stderr, "gettimeofday failed: %s\n", strerror(errno));
Expand Down

0 comments on commit 524945f

Please sign in to comment.