[master] 3a6b639e8 Rename strerror() to VAS_errtxt() for consistency.

Poul-Henning Kamp phk at FreeBSD.org
Fri Apr 30 14:54:06 UTC 2021


commit 3a6b639e8626427e77e4fe8de9227c679b0f72ad
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Apr 30 14:50:03 2021 +0000

    Rename strerror() to VAS_errtxt() for consistency.

diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index ae4da2f84..8ee346cba 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -509,7 +509,7 @@ vca_accept_task(struct worker *wrk, void *arg)
 
 			VSL(SLT_SessError, 0, "%s %s %s %d %d \"%s\"",
 			    wa.acceptlsock->name, laddr, lport,
-			    ls->sock, i, vstrerror(i));
+			    ls->sock, i, VAS_errtxt(i));
 			(void)Pool_TrySumstat(wrk);
 			continue;
 		}
@@ -629,18 +629,18 @@ ccf_start(struct cli *cli, const char * const *av, void *priv)
 		    VTCP_fastopen(ls->sock, cache_param->listen_depth))
 			VSL(SLT_Error, 0,
 			    "Kernel TCP Fast Open: sock=%d, errno=%d %s",
-			    ls->sock, errno, vstrerror(errno));
+			    ls->sock, errno, VAS_errtxt(errno));
 		if (listen(ls->sock, cache_param->listen_depth)) {
 			VCLI_SetResult(cli, CLIS_CANT);
 			VCLI_Out(cli, "Listen failed on socket '%s': %s",
-			    ls->endpoint, vstrerror(errno));
+			    ls->endpoint, VAS_errtxt(errno));
 			return;
 		}
 		vca_tcp_opt_set(ls->sock, ls->uds, 1);
 		if (cache_param->accept_filter && VTCP_filter_http(ls->sock))
 			VSL(SLT_Error, 0,
 			    "Kernel filtering: sock=%d, errno=%d %s",
-			    ls->sock, errno, vstrerror(errno));
+			    ls->sock, errno, VAS_errtxt(errno));
 	}
 
 	need_test = 1;
diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index d60cc704c..829b56595 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -162,7 +162,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
 		Lck_Unlock(bp->director->mtx);
 		VSLb(bo->vsl, SLT_FetchError,
 		     "backend %s: fail errno %d (%s)",
-		     VRT_BACKEND_string(dir), err, vstrerror(err));
+		     VRT_BACKEND_string(dir), err, VAS_errtxt(err));
 		VSC_C_main->backend_fail++;
 		bo->htc = NULL;
 		return (NULL);
@@ -186,7 +186,7 @@ vbe_dir_getfd(VRT_CTX, struct worker *wrk, VCL_BACKEND dir, struct backend *bp,
 		VSLb(bo->vsl, SLT_FetchError,
 		     "backend %s: proxy write errno %d (%s)",
 		     VRT_BACKEND_string(dir),
-		     errno, vstrerror(errno));
+		     errno, VAS_errtxt(errno));
 		// account as if connect failed - good idea?
 		VSC_C_main->backend_fail++;
 		bo->htc = NULL;
diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index 18126cef2..f56a9fac6 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -225,11 +225,11 @@ vbp_write(struct vbp_target *vt, int *sock, const void *buf, size_t len)
 		if (i < 0) {
 			vt->err_xmit |= 1;
 			bprintf(vt->resp_buf, "Write error %d (%s)",
-				errno, vstrerror(errno));
+				errno, VAS_errtxt(errno));
 		} else {
 			bprintf(vt->resp_buf,
 				"Short write (%d/%zu) error %d (%s)",
-				i, len, errno, vstrerror(errno));
+				i, len, errno, VAS_errtxt(errno));
 		}
 		VTCP_close(sock);
 		return (-1);
@@ -282,7 +282,7 @@ vbp_poke(struct vbp_target *vt)
 
 	s = VCP_Open(vt->conn_pool, t_end - t_now, &sa, &err);
 	if (s < 0) {
-		bprintf(vt->resp_buf, "Open error %d (%s)", err, vstrerror(err));
+		bprintf(vt->resp_buf, "Open error %d (%s)", err, VAS_errtxt(err));
 		Lck_Lock(&vbp_mtx);
 		if (vt->backend)
 			VBE_Connect_Error(vt->backend->vsc, err);
@@ -357,7 +357,7 @@ vbp_poke(struct vbp_target *vt)
 			if (!i)
 				errno = ETIMEDOUT;
 			bprintf(vt->resp_buf, "Poll error %d (%s)",
-			    errno, vstrerror(errno));
+			    errno, VAS_errtxt(errno));
 			i = -1;
 			break;
 		}
@@ -370,7 +370,7 @@ vbp_poke(struct vbp_target *vt)
 		if (i <= 0) {
 			if (i < 0)
 				bprintf(vt->resp_buf, "Read error %d (%s)",
-					errno, vstrerror(errno));
+					errno, VAS_errtxt(errno));
 			break;
 		}
 		rlen += i;
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 63f605a05..68309705f 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -769,7 +769,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
 	pan_backtrace(pan_vsb);
 
 	if (err)
-		VSB_printf(pan_vsb, "errno = %d (%s)\n", err, vstrerror(err));
+		VSB_printf(pan_vsb, "errno = %d (%s)\n", err, VAS_errtxt(err));
 
 	pan_argv(pan_vsb);
 
diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index 9b5d59c82..fcdab5d6f 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -532,7 +532,7 @@ pool_breed(struct pool *qp)
 	if (errno) {
 		FREE_OBJ(pi);
 		VSL(SLT_Debug, 0, "Create worker thread failed %d %s",
-		    errno, vstrerror(errno));
+		    errno, VAS_errtxt(errno));
 		Lck_Lock(&pool_mtx);
 		VSC_C_main->threads_failed++;
 		Lck_Unlock(&pool_mtx);
diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index 99a4c58d9..dfd0555b4 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -131,7 +131,7 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr_hdrbytes,
 			assert(i < 0);
 			VSLb(bo->vsl, SLT_FetchError,
 			    "req.body read error: %d (%s)",
-			    errno, vstrerror(errno));
+			    errno, VAS_errtxt(errno));
 			bo->req->doclose = SC_RX_BODY;
 		}
 		if (do_chunked)
@@ -153,7 +153,7 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr_hdrbytes,
 
 	if (sc != SC_NULL) {
 		VSLb(bo->vsl, SLT_FetchError, "backend write error: %d (%s)",
-		    errno, vstrerror(errno));
+		    errno, VAS_errtxt(errno));
 		VSLb_ts_busyobj(bo, "Bereq", W_TIM_real(wrk));
 		htc->doclose = sc;
 		return (-1);
diff --git a/bin/varnishd/http1/cache_http1_line.c b/bin/varnishd/http1/cache_http1_line.c
index 2499c68cb..c275c92ef 100644
--- a/bin/varnishd/http1/cache_http1_line.c
+++ b/bin/varnishd/http1/cache_http1_line.c
@@ -233,7 +233,7 @@ V1L_Flush(const struct worker *wrk)
 		if (i <= 0) {
 			VSLb(v1l->vsl, SLT_Debug,
 			    "Write error, retval = %zd, len = %zd, errno = %s",
-			    i, v1l->liov, vstrerror(errno));
+			    i, v1l->liov, VAS_errtxt(errno));
 			AZ(v1l->werr);
 			if (errno == EPIPE)
 				v1l->werr = SC_REM_CLOSE;
diff --git a/bin/varnishd/http1/cache_http1_vfp.c b/bin/varnishd/http1/cache_http1_vfp.c
index 13e042e6f..835db3599 100644
--- a/bin/varnishd/http1/cache_http1_vfp.c
+++ b/bin/varnishd/http1/cache_http1_vfp.c
@@ -79,7 +79,7 @@ v1f_read(const struct vfp_ctx *vc, struct http_conn *htc, void *d, ssize_t len)
 		if (i < 0) {
 			VTCP_Assert(i);
 			VSLb(vc->wrk->vsl, SLT_FetchError,
-			    "%s", vstrerror(errno));
+			    "%s", VAS_errtxt(errno));
 			return (i);
 		}
 		if (i == 0)
diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c
index 36d4a1c0e..26207a3bc 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -260,7 +260,7 @@ h2_ou_session(struct worker *wrk, struct h2_sess *h2,
 	VTCP_Assert(sz);
 	if (sz != strlen(h2_resp_101)) {
 		VSLb(h2->vsl, SLT_Debug, "H2: Upgrade: Error writing 101"
-		    " response: %s\n", vstrerror(errno));
+		    " response: %s\n", VAS_errtxt(errno));
 		return (h2_ou_rel(wrk, req));
 	}
 
diff --git a/bin/varnishd/mgt/mgt_acceptor.c b/bin/varnishd/mgt/mgt_acceptor.c
index 1af17f365..6488c5b03 100644
--- a/bin/varnishd/mgt/mgt_acceptor.c
+++ b/bin/varnishd/mgt/mgt_acceptor.c
@@ -134,7 +134,7 @@ MAC_reopen_sockets(void)
 			fail = err;
 		MGT_Complain(C_ERR,
 		    "Could not reopen listen socket %s: %s",
-		    ls->endpoint, vstrerror(err));
+		    ls->endpoint, VAS_errtxt(err));
 	}
 	return (fail);
 }
@@ -168,7 +168,7 @@ mk_listen_sock(const struct listen_arg *la, const struct suckaddr *sa)
 		FREE_OBJ(ls);
 		if (fail != EAFNOSUPPORT)
 			ARGV_ERR("Could not get socket %s: %s\n",
-			    la->endpoint, vstrerror(fail));
+			    la->endpoint, VAS_errtxt(fail));
 		return (NULL);
 	}
 	return (ls);
@@ -331,7 +331,7 @@ MAC_Arg(const char *spec)
 					 val);
 			if (errno)
 				ARGV_ERR("Cannot parse mode sub-arg %s in -a: "
-					 "%s\n", val, vstrerror(errno));
+					 "%s\n", val, VAS_errtxt(errno));
 			if (m <= 0 || m > 0777)
 				ARGV_ERR("Mode sub-arg %s out of range in -a\n",
 					 val);
diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index 84f3c182e..5af419fed 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -629,7 +629,7 @@ MCH_Cli_Fail(void)
 		    " killed it.", (intmax_t)child_pid);
 	else
 		MGT_Complain(C_ERR, "Failed to kill child with PID %jd: %s",
-		    (intmax_t)child_pid, vstrerror(errno));
+		    (intmax_t)child_pid, VAS_errtxt(errno));
 }
 
 /*=====================================================================
diff --git a/bin/varnishd/mgt/mgt_cli.c b/bin/varnishd/mgt/mgt_cli.c
index 11cff7889..9d307f793 100644
--- a/bin/varnishd/mgt/mgt_cli.c
+++ b/bin/varnishd/mgt/mgt_cli.c
@@ -281,7 +281,7 @@ mcf_auth(struct cli *cli, const char *const *av, void *priv)
 	fd = open(secret_file, O_RDONLY);
 	if (fd < 0) {
 		VCLI_Out(cli, "Cannot open secret file (%s)\n",
-		    vstrerror(errno));
+		    VAS_errtxt(errno));
 		VCLI_SetResult(cli, CLIS_CANT);
 		VJ_master(JAIL_MASTER_LOW);
 		return;
@@ -591,7 +591,7 @@ Marg_connect(const struct vev *e, int what)
 	M_fd = VTCP_connected(M_fd);
 	if (M_fd < 0) {
 		MGT_Complain(C_INFO, "Could not connect to CLI-master: %s",
-			vstrerror(errno));
+			VAS_errtxt(errno));
 		ma = VTAILQ_FIRST(&m_addr_list);
 		AN(ma);
 		VTAILQ_REMOVE(&m_addr_list, ma, list);
diff --git a/bin/varnishd/mgt/mgt_jail.c b/bin/varnishd/mgt/mgt_jail.c
index b65005fc6..db5c1275c 100644
--- a/bin/varnishd/mgt/mgt_jail.c
+++ b/bin/varnishd/mgt/mgt_jail.c
@@ -151,18 +151,18 @@ VJ_make_workdir(const char *dname)
 		VJ_master(JAIL_MASTER_FILE);
 		if (mkdir(dname, 0755) < 0 && errno != EEXIST)
 			ARGV_ERR("Cannot create working directory '%s': %s\n",
-				 dname, vstrerror(errno));
+				 dname, VAS_errtxt(errno));
 	}
 
 	if (chdir(dname) < 0)
 		ARGV_ERR("Cannot change to working directory '%s': %s\n",
-		    dname, vstrerror(errno));
+		    dname, VAS_errtxt(errno));
 
 	i = open("_.testfile", O_RDWR|O_CREAT|O_EXCL, 0600);
 	if (i < 0)
 		ARGV_ERR("Cannot create test-file in %s (%s)\n"
 		    "Check permissions (or delete old directory)\n",
-		    dname, vstrerror(errno));
+		    dname, VAS_errtxt(errno));
 	closefd(&i);
 	AZ(unlink("_.testfile"));
 	VJ_master(JAIL_MASTER_LOW);
@@ -186,11 +186,11 @@ VJ_make_subdir(const char *dname, const char *what, struct vsb *vsb)
 		if (vsb != NULL) {
 			VSB_printf(vsb,
 			    "Cannot create %s directory '%s': %s\n",
-			    what, dname, vstrerror(e));
+			    what, dname, VAS_errtxt(e));
 		} else {
 			MGT_Complain(C_ERR,
 			    "Cannot create %s directory '%s': %s",
-			    what, dname, vstrerror(e));
+			    what, dname, VAS_errtxt(e));
 		}
 		return (1);
 	}
diff --git a/bin/varnishd/mgt/mgt_jail_unix.c b/bin/varnishd/mgt/mgt_jail_unix.c
index c0d5c50d9..d979c00f0 100644
--- a/bin/varnishd/mgt/mgt_jail_unix.c
+++ b/bin/varnishd/mgt/mgt_jail_unix.c
@@ -256,11 +256,11 @@ vju_make_subdir(const char *dname, const char *what, struct vsb *vsb)
 		if (vsb != NULL) {
 			VSB_printf(vsb,
 			    "Cannot create %s directory '%s': %s\n",
-			    what, dname, vstrerror(e));
+			    what, dname, VAS_errtxt(e));
 		} else {
 			MGT_Complain(C_ERR,
 			    "Cannot create %s directory '%s': %s",
-			    what, dname, vstrerror(e));
+			    what, dname, VAS_errtxt(e));
 		}
 		return (1);
 	}
@@ -280,7 +280,7 @@ vju_make_workdir(const char *dname, const char *what, struct vsb *vsb)
 
 	if (mkdir(dname, 0755) < 0 && errno != EEXIST) {
 		MGT_Complain(C_ERR, "Cannot create working directory '%s': %s",
-		    dname, vstrerror(errno));
+		    dname, VAS_errtxt(errno));
 		return (1);
 	}
 	//lint -e{570}
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 9ad6d8a7c..f16e13127 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -232,7 +232,7 @@ make_secret(const char *dirname)
 	fdo = open(fn, O_RDWR|O_CREAT|O_TRUNC, 0640);
 	if (fdo < 0)
 		ARGV_ERR("Cannot create secret-file in %s (%s)\n",
-		    dirname, vstrerror(errno));
+		    dirname, VAS_errtxt(errno));
 
 	for (i = 0; i < 256; i++) {
 		AZ(VRND_RandomCrypto(&b, 1));
@@ -326,7 +326,7 @@ mgt_eric(void)
 
 	switch (fork()) {
 	case -1:
-		fprintf(stderr, "Fork() failed: %s\n", vstrerror(errno));
+		fprintf(stderr, "Fork() failed: %s\n", VAS_errtxt(errno));
 		exit(-1);
 	case 0:
 		closefd(&eric_pipes[0]);
@@ -426,7 +426,7 @@ mgt_f_read(const char *fn)
 	VFIL_setpath(&vcl_path, mgt_vcl_path);
 	if (VFIL_searchpath(vcl_path, NULL, &f, fn, &fnp) || f == NULL) {
 		ARGV_ERR("Cannot read -f file '%s' (%s)\n",
-		    fnp != NULL ? fnp : fn, vstrerror(errno));
+		    fnp != NULL ? fnp : fn, VAS_errtxt(errno));
 	}
 	free(fa->farg);
 	fa->farg = fnp;
@@ -454,7 +454,7 @@ create_pid_file(pid_t *ppid, const char *fmt, ...)
 		    (intmax_t)*ppid, VSB_data(vsb));
 	if (pfh == NULL)
 		ARGV_ERR("Could not open pid-file (%s): %s\n",
-		    VSB_data(vsb), vstrerror(errno));
+		    VSB_data(vsb), VAS_errtxt(errno));
 	VJ_master(JAIL_MASTER_LOW);
 	VSB_destroy(&vsb);
 	return (pfh);
@@ -667,7 +667,7 @@ main(int argc, char * const *argv)
 			I_fd = open(optarg, O_RDONLY);
 			if (I_fd < 0)
 				ARGV_ERR("\tCant open %s: %s\n",
-				    optarg, vstrerror(errno));
+				    optarg, VAS_errtxt(errno));
 			VJ_master(JAIL_MASTER_LOW);
 			break;
 		case 'l':
@@ -774,13 +774,13 @@ main(int argc, char * const *argv)
 		o = open(S_arg, O_RDONLY, 0);
 		if (o < 0)
 			ARGV_ERR("Cannot open -S file (%s): %s\n",
-			    S_arg, vstrerror(errno));
+			    S_arg, VAS_errtxt(errno));
 		closefd(&o);
 		VJ_master(JAIL_MASTER_LOW);
 	}
 
 	if (VIN_n_Arg(n_arg, &workdir) != 0)
-		ARGV_ERR("Invalid instance (-n) name: %s\n", vstrerror(errno));
+		ARGV_ERR("Invalid instance (-n) name: %s\n", VAS_errtxt(errno));
 
 	if (i_arg == NULL || *i_arg == '\0')
 		i_arg = mgt_HostName();
@@ -792,7 +792,7 @@ main(int argc, char * const *argv)
 
 	if (VJ_make_workdir(workdir))
 		ARGV_ERR("Cannot create working directory (%s): %s\n",
-		    workdir, vstrerror(errno));
+		    workdir, VAS_errtxt(errno));
 
 	VJ_master(JAIL_MASTER_SYSTEM);
 	AZ(system("rm -rf vmod_cache"));
@@ -801,7 +801,7 @@ main(int argc, char * const *argv)
 	if (VJ_make_subdir("vmod_cache", "VMOD cache", NULL)) {
 		ARGV_ERR(
 		    "Cannot create vmod directory (%s/vmod_cache): %s\n",
-		    workdir, vstrerror(errno));
+		    workdir, VAS_errtxt(errno));
 	}
 
 	if (C_flag)
diff --git a/bin/varnishd/mgt/mgt_symtab.c b/bin/varnishd/mgt/mgt_symtab.c
index 530c89d17..88b9aa844 100644
--- a/bin/varnishd/mgt/mgt_symtab.c
+++ b/bin/varnishd/mgt/mgt_symtab.c
@@ -85,13 +85,13 @@ mgt_vcl_cache_vmod(const char *nm, const char *fm, const char *to)
 		return (0);
 	if (fo < 0) {
 		fprintf(stderr, "While creating copy of vmod %s:\n\t%s: %s\n",
-		    nm, to, vstrerror(errno));
+		    nm, to, VAS_errtxt(errno));
 		return (1);
 	}
 	fi = open(fm, O_RDONLY);
 	if (fi < 0) {
 		fprintf(stderr, "Opening vmod %s from %s: %s\n",
-		    nm, fm, vstrerror(errno));
+		    nm, fm, VAS_errtxt(errno));
 		AZ(unlink(to));
 		closefd(&fo);
 		return (1);
@@ -102,7 +102,7 @@ mgt_vcl_cache_vmod(const char *nm, const char *fm, const char *to)
 			break;
 		if (sz < 0 || sz != write(fo, buf, sz)) {
 			fprintf(stderr, "Copying vmod %s: %s\n",
-			    nm, vstrerror(errno));
+			    nm, VAS_errtxt(errno));
 			AZ(unlink(to));
 			ret = 1;
 			break;
diff --git a/bin/varnishd/mgt/mgt_vcc.c b/bin/varnishd/mgt/mgt_vcc.c
index 729804b5a..5775a2fb9 100644
--- a/bin/varnishd/mgt/mgt_vcc.c
+++ b/bin/varnishd/mgt/mgt_vcc.c
@@ -201,13 +201,13 @@ mgt_vcc_touchfile(const char *fn, struct vsb *sb)
 
 	i = open(fn, O_WRONLY|O_CREAT|O_TRUNC, 0640);
 	if (i < 0) {
-		VSB_printf(sb, "Failed to create %s: %s", fn, vstrerror(errno));
+		VSB_printf(sb, "Failed to create %s: %s", fn, VAS_errtxt(errno));
 		return (2);
 	}
 	if (fchown(i, mgt_param.uid, mgt_param.gid) != 0)
 		if (geteuid() == 0)
 			VSB_printf(sb, "Failed to change owner on %s: %s\n",
-			    fn, vstrerror(errno));
+			    fn, VAS_errtxt(errno));
 	closefd(&i);
 	return (0);
 }
diff --git a/bin/varnishd/storage/mgt_storage_persistent.c b/bin/varnishd/storage/mgt_storage_persistent.c
index 372dfb953..f8d797f85 100644
--- a/bin/varnishd/storage/mgt_storage_persistent.c
+++ b/bin/varnishd/storage/mgt_storage_persistent.c
@@ -210,7 +210,7 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av)
 
 	if (sc->base == MAP_FAILED)
 		ARGV_ERR("(-spersistent) failed to mmap (%s)\n",
-		    vstrerror(errno));
+		    VAS_errtxt(errno));
 	if (target != NULL && sc->base != target)
 		fprintf(stderr, "WARNING: Persistent silo lost to ASLR %s\n",
 		    sc->filename);
diff --git a/bin/varnishd/storage/stevedore_utils.c b/bin/varnishd/storage/stevedore_utils.c
index e46b5485e..ac70b7aaf 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -103,7 +103,7 @@ STV_GetFile(const char *fn, int *fdp, const char **fnp, const char *ctx)
 		fd = mkstemp(buf);
 		if (fd < 0)
 			ARGV_ERR("(%s) \"%s\" mkstemp(%s) failed (%s)\n",
-			    ctx, fn, buf, vstrerror(errno));
+			    ctx, fn, buf, VAS_errtxt(errno));
 		AZ(unlink(buf));
 		*fnp = strdup(buf);
 		AN(*fnp);
@@ -112,7 +112,7 @@ STV_GetFile(const char *fn, int *fdp, const char **fnp, const char *ctx)
 		fd = open(fn, O_RDWR | O_LARGEFILE);
 		if (fd < 0)
 			ARGV_ERR("(%s) \"%s\" could not open (%s)\n",
-			    ctx, fn, vstrerror(errno));
+			    ctx, fn, VAS_errtxt(errno));
 		*fnp = fn;
 		retval = 0;
 	} else
diff --git a/bin/varnishd/storage/storage_file.c b/bin/varnishd/storage/storage_file.c
index 8d842365e..3c61a61c5 100644
--- a/bin/varnishd/storage/storage_file.c
+++ b/bin/varnishd/storage/storage_file.c
@@ -167,7 +167,7 @@ smf_init(struct stevedore *parent, int ac, char * const *av)
 	MCH_Fd_Inherit(sc->fd, "storage_file");
 	sc->filesize = STV_FileSize(sc->fd, size, &sc->pagesize, "-sfile");
 	if (VFIL_allocate(sc->fd, (off_t)sc->filesize, 0))
-		ARGV_ERR("(-sfile) allocation error: %s\n", vstrerror(errno));
+		ARGV_ERR("(-sfile) allocation error: %s\n", VAS_errtxt(errno));
 }
 
 /*--------------------------------------------------------------------
diff --git a/include/vas.h b/include/vas.h
index ca93fbf43..302170ae2 100644
--- a/include/vas.h
+++ b/include/vas.h
@@ -44,7 +44,7 @@
 #include <errno.h>
 #include <stddef.h>	// size_t
 
-const char * vstrerror(int e);
+const char * VAS_errtxt(int e);
 
 enum vas_e {
 	VAS_WRONG,
diff --git a/lib/libvarnish/vas.c b/lib/libvarnish/vas.c
index 392303fdd..b64418cc9 100644
--- a/lib/libvarnish/vas.c
+++ b/lib/libvarnish/vas.c
@@ -42,7 +42,7 @@
 #include "vas.h"
 
 const char *
-vstrerror(int e)
+VAS_errtxt(int e)
 {
 	const char *p;
 	int oerrno = errno;
diff --git a/lib/libvarnish/vss.c b/lib/libvarnish/vss.c
index 9feb7c584..45a3d2f2a 100644
--- a/lib/libvarnish/vss.c
+++ b/lib/libvarnish/vss.c
@@ -132,7 +132,7 @@ vss_resolve(const char *addr, const char *def_port, int family, int socktype,
 	free(p);
 
 	if (ret == EAI_SYSTEM)
-		*errp = vstrerror(errno);
+		*errp = VAS_errtxt(errno);
 	else if (ret != 0)
 		*errp = gai_strerror(ret);
 
diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c
index 9de0389f2..d5afe460c 100644
--- a/lib/libvarnish/vtcp.c
+++ b/lib/libvarnish/vtcp.c
@@ -76,7 +76,7 @@ vtcp_sa_to_ascii(const void *sa, socklen_t l, char *abuf, unsigned alen,
 		 */
 		fprintf(stderr, "getnameinfo = %d %s\n", i, gai_strerror(i));
 		if (i == EAI_SYSTEM)
-			fprintf(stderr, "errno = %d %s\n", errno, vstrerror(errno));
+			fprintf(stderr, "errno = %d %s\n", errno, VAS_errtxt(errno));
 		if (abuf != NULL)
 			(void)snprintf(abuf, alen, "Conversion");
 		if (pbuf != NULL)


More information about the varnish-commit mailing list