Skip to content

Commit

Permalink
Revert "do not pass a NULL pointer from strerror() to vsnprintf via VSL"
Browse files Browse the repository at this point in the history
This reverts commit ee33662.
  • Loading branch information
nigoroll committed Nov 5, 2018
1 parent 8443432 commit ec0edf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
8 changes: 2 additions & 6 deletions bin/varnishd/cache/cache_panic.c
Expand Up @@ -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)
Expand Down
8 changes: 1 addition & 7 deletions bin/varnishd/cache/cache_wrk.c
Expand Up @@ -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));
Expand All @@ -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);
Expand Down

0 comments on commit ec0edf5

Please sign in to comment.