Permalink
Browse files

Revert "do not pass a NULL pointer from strerror() to vsnprintf via VSL"

This reverts commit ee33662.
  • Loading branch information...
nigoroll committed Nov 1, 2018
1 parent 8443432 commit ec0edf5e679ea5557e633fe2d737bd46e1683543
Showing with 3 additions and 13 deletions.
  1. +2 −6 bin/varnishd/cache/cache_panic.c
  2. +1 −7 bin/varnishd/cache/cache_wrk.c
@@ -666,12 +666,8 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
pan_backtrace(pan_vsb);
if (err) {
q = strerror(err);
if (q == NULL)
q = "(strerror failed)";
VSB_printf(pan_vsb, "errno = %d (%s)\n", err, q);
}
if (err)
VSB_printf(pan_vsb, "errno = %d (%s)\n", err, strerror(err));
q = THR_GetName();
if (q != NULL)
@@ -437,8 +437,6 @@ pool_breed(struct pool *qp)
pthread_t tp;
pthread_attr_t tp_attr;
struct pool_info *pi;
const char *strerr;
int err;
AZ(pthread_attr_init(&tp_attr));
AZ(pthread_attr_setdetachstate(&tp_attr, PTHREAD_CREATE_DETACHED));
@@ -454,12 +452,8 @@ pool_breed(struct pool *qp)
pi->qp = qp;
if (pthread_create(&tp, &tp_attr, pool_thread, pi)) {
err = errno;
strerr = strerror(errno);
if (strerr == NULL)
strerr = "(strerror failed)";
VSL(SLT_Debug, 0, "Create worker thread failed %d %s",
err, strerr);
errno, strerror(errno));
Lck_Lock(&pool_mtx);
VSC_C_main->threads_failed++;
Lck_Unlock(&pool_mtx);

0 comments on commit ec0edf5

Please sign in to comment.