vstrerror has been renamed to VAS_errtxt

parent b9fb4c59
...@@ -161,7 +161,7 @@ check(union sigval val) ...@@ -161,7 +161,7 @@ check(union sigval val)
goto out; goto out;
} }
VERRMSG(rdr, errbuf, "%s.%s: cannot open %s: %s", rdr->vcl_name, VERRMSG(rdr, errbuf, "%s.%s: cannot open %s: %s", rdr->vcl_name,
rdr->obj_name, info->path, vstrerror(errno)); rdr->obj_name, info->path, VAS_errtxt(errno));
VSL(SLT_Error, 0, errbuf); VSL(SLT_Error, 0, errbuf);
flags |= RDR_ERROR; flags |= RDR_ERROR;
goto out; goto out;
...@@ -172,7 +172,7 @@ check(union sigval val) ...@@ -172,7 +172,7 @@ check(union sigval val)
if (fstat(fd, &st) != 0) { if (fstat(fd, &st) != 0) {
VERRMSG(rdr, errbuf, "%s.%s: cannot read info about %s: %s", VERRMSG(rdr, errbuf, "%s.%s: cannot read info about %s: %s",
rdr->vcl_name, rdr->obj_name, info->path, rdr->vcl_name, rdr->obj_name, info->path,
vstrerror(errno)); VAS_errtxt(errno));
VSL(SLT_Error, 0, errbuf); VSL(SLT_Error, 0, errbuf);
flags |= RDR_ERROR; flags |= RDR_ERROR;
goto out; goto out;
...@@ -213,7 +213,7 @@ check(union sigval val) ...@@ -213,7 +213,7 @@ check(union sigval val)
== MAP_FAILED) { == MAP_FAILED) {
VERRMSG(rdr, errbuf, "%s.%s: could not map %s: %s", VERRMSG(rdr, errbuf, "%s.%s: could not map %s: %s",
rdr->vcl_name, rdr->obj_name, info->path, rdr->vcl_name, rdr->obj_name, info->path,
vstrerror(errno)); VAS_errtxt(errno));
VSL(SLT_Error, 0, errbuf); VSL(SLT_Error, 0, errbuf);
flags |= RDR_ERROR; flags |= RDR_ERROR;
goto out; goto out;
...@@ -223,7 +223,7 @@ check(union sigval val) ...@@ -223,7 +223,7 @@ check(union sigval val)
if ((err = posix_madvise(addr, st.st_size + 1, POSIX_MADV_SEQUENTIAL)) if ((err = posix_madvise(addr, st.st_size + 1, POSIX_MADV_SEQUENTIAL))
!= 0) { != 0) {
VERRMSG(rdr, errbuf, "%s.%s: madvise(SEQUENTIAL): %s", VERRMSG(rdr, errbuf, "%s.%s: madvise(SEQUENTIAL): %s",
rdr->vcl_name, rdr->obj_name, vstrerror(err)); rdr->vcl_name, rdr->obj_name, VAS_errtxt(err));
VSL(SLT_Error, 0, errbuf); VSL(SLT_Error, 0, errbuf);
flags |= RDR_ERROR; flags |= RDR_ERROR;
goto out; goto out;
...@@ -231,7 +231,7 @@ check(union sigval val) ...@@ -231,7 +231,7 @@ check(union sigval val)
if ((err = posix_madvise(addr, st.st_size + 1, POSIX_MADV_WILLNEED)) if ((err = posix_madvise(addr, st.st_size + 1, POSIX_MADV_WILLNEED))
!= 0) { != 0) {
VERRMSG(rdr, errbuf, "%s.%s: madvise(WILLNEED): %s", VERRMSG(rdr, errbuf, "%s.%s: madvise(WILLNEED): %s",
rdr->vcl_name, rdr->obj_name, vstrerror(err)); rdr->vcl_name, rdr->obj_name, VAS_errtxt(err));
VSL(SLT_Error, 0, errbuf); VSL(SLT_Error, 0, errbuf);
flags |= RDR_ERROR; flags |= RDR_ERROR;
goto out; goto out;
...@@ -265,7 +265,7 @@ check(union sigval val) ...@@ -265,7 +265,7 @@ check(union sigval val)
if (munmap(prev, rdr->info->len) != 0) { if (munmap(prev, rdr->info->len) != 0) {
VERRMSG(rdr, errbuf, "%s.%s: unmap failed: %s", VERRMSG(rdr, errbuf, "%s.%s: unmap failed: %s",
rdr->vcl_name, rdr->obj_name, rdr->vcl_name, rdr->obj_name,
vstrerror(errno)); VAS_errtxt(errno));
VSL(SLT_Error, 0, errbuf); VSL(SLT_Error, 0, errbuf);
flags |= RDR_ERROR; flags |= RDR_ERROR;
} }
...@@ -347,7 +347,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -347,7 +347,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
ALLOC_OBJ(info, FILE_INFO_MAGIC); ALLOC_OBJ(info, FILE_INFO_MAGIC);
if (info == NULL) { if (info == NULL) {
VFAIL(ctx, "new %s: allocating space for file info: %s", VFAIL(ctx, "new %s: allocating space for file info: %s",
vcl_name, vstrerror(errno)); vcl_name, VAS_errtxt(errno));
return; return;
} }
...@@ -355,7 +355,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -355,7 +355,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
ALLOC_OBJ(rdr, FILE_READER_MAGIC); ALLOC_OBJ(rdr, FILE_READER_MAGIC);
if (rdr == NULL) { if (rdr == NULL) {
VFAIL(ctx, "new %s: allocating space for object: %s", VFAIL(ctx, "new %s: allocating space for object: %s",
vcl_name, vstrerror(errno)); vcl_name, VAS_errtxt(errno));
return; return;
} }
...@@ -364,7 +364,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -364,7 +364,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
rdr->lock = malloc(sizeof(*rdr->lock)); rdr->lock = malloc(sizeof(*rdr->lock));
if (rdr->lock == NULL) { if (rdr->lock == NULL) {
VFAIL(ctx, "new %s: allocating space for lock: %s", VFAIL(ctx, "new %s: allocating space for lock: %s",
vcl_name, vstrerror(errno)); vcl_name, VAS_errtxt(errno));
return; return;
} }
...@@ -374,7 +374,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -374,7 +374,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
info->sha256 = calloc(1, VSHA256_DIGEST_LENGTH); info->sha256 = calloc(1, VSHA256_DIGEST_LENGTH);
if (info->sha256 == NULL) { if (info->sha256 == NULL) {
VFAIL(ctx, "new %s: allocating space for SHA256: %s", VFAIL(ctx, "new %s: allocating space for SHA256: %s",
vcl_name, vstrerror(errno)); vcl_name, VAS_errtxt(errno));
return; return;
} }
} }
...@@ -436,7 +436,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -436,7 +436,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
errno = 0; errno = 0;
if (pthread_rwlock_init(rdr->lock, NULL) != 0) { if (pthread_rwlock_init(rdr->lock, NULL) != 0) {
VFAIL(ctx, "new %s: initializing lock: %s", vcl_name, VFAIL(ctx, "new %s: initializing lock: %s", vcl_name,
vstrerror(errno)); VAS_errtxt(errno));
return; return;
} }
...@@ -446,7 +446,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -446,7 +446,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
rdr->errbuf = malloc(rdr->errlen); rdr->errbuf = malloc(rdr->errlen);
if (rdr->errbuf == NULL) { if (rdr->errbuf == NULL) {
VFAIL(ctx, "new %s: allocating error message buffer: %s", VFAIL(ctx, "new %s: allocating error message buffer: %s",
vcl_name, vstrerror(errno)); vcl_name, VAS_errtxt(errno));
return; return;
} }
...@@ -458,7 +458,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -458,7 +458,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
errno = 0; errno = 0;
if (timer_create(CLOCK_MONOTONIC, &sigev, &timerid) != 0) { if (timer_create(CLOCK_MONOTONIC, &sigev, &timerid) != 0) {
VFAIL(ctx, "new %s: cannot create update timer: %s", vcl_name, VFAIL(ctx, "new %s: cannot create update timer: %s", vcl_name,
vstrerror(errno)); VAS_errtxt(errno));
return; return;
} }
rdr->timerid = timerid; rdr->timerid = timerid;
...@@ -476,7 +476,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -476,7 +476,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
ALLOC_OBJ(objent, OBJ_ENTRY_MAGIC); ALLOC_OBJ(objent, OBJ_ENTRY_MAGIC);
if (objent == NULL) { if (objent == NULL) {
VFAIL(ctx, "new %s: allocating object list entry: %s", vcl_name, VFAIL(ctx, "new %s: allocating object list entry: %s", vcl_name,
vstrerror(errno)); VAS_errtxt(errno));
return; return;
} }
objent->obj = rdr; objent->obj = rdr;
...@@ -490,7 +490,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp, ...@@ -490,7 +490,7 @@ vmod_reader__init(VRT_CTX, struct VPFX(file_reader) **rdrp,
errno = 0; errno = 0;
if (timer_settime(timerid, 0, &timerspec, NULL) != 0) { if (timer_settime(timerid, 0, &timerspec, NULL) != 0) {
VFAIL(ctx, "new %s: cannot start update timer: %s", vcl_name, VFAIL(ctx, "new %s: cannot start update timer: %s", vcl_name,
vstrerror(errno)); VAS_errtxt(errno));
return; return;
} }
rdr->flags |= RDR_TIMER_INIT; rdr->flags |= RDR_TIMER_INIT;
...@@ -528,7 +528,7 @@ vmod_reader__fini(struct VPFX(file_reader) **rdrp) ...@@ -528,7 +528,7 @@ vmod_reader__fini(struct VPFX(file_reader) **rdrp)
if (timer_delete(rdr->timerid) != 0) if (timer_delete(rdr->timerid) != 0)
VSL(SLT_Error, 0, "vmod file %s.%s finalization: " VSL(SLT_Error, 0, "vmod file %s.%s finalization: "
"cannot delete timer: %s", rdr->vcl_name, "cannot delete timer: %s", rdr->vcl_name,
rdr->obj_name, vstrerror(errno)); rdr->obj_name, VAS_errtxt(errno));
} }
if (rdr->flags & RDR_MAPPED) { if (rdr->flags & RDR_MAPPED) {
...@@ -541,7 +541,7 @@ vmod_reader__fini(struct VPFX(file_reader) **rdrp) ...@@ -541,7 +541,7 @@ vmod_reader__fini(struct VPFX(file_reader) **rdrp)
if (munmap(rdr->addr, rdr->info->len) != 0) if (munmap(rdr->addr, rdr->info->len) != 0)
VSL(SLT_Error, 0, "vmod file %s.%s finalization: " VSL(SLT_Error, 0, "vmod file %s.%s finalization: "
"unmap failed: %s", rdr->vcl_name, rdr->obj_name, "unmap failed: %s", rdr->vcl_name, rdr->obj_name,
vstrerror(errno)); VAS_errtxt(errno));
} }
if (rdr->info != NULL) { if (rdr->info != NULL) {
...@@ -716,7 +716,7 @@ vmod_reader_next_check(VRT_CTX, struct VPFX(file_reader) *rdr) ...@@ -716,7 +716,7 @@ vmod_reader_next_check(VRT_CTX, struct VPFX(file_reader) *rdr)
errno = 0; errno = 0;
if (timer_gettime(rdr->timerid, &t) != 0) { if (timer_gettime(rdr->timerid, &t) != 0) {
VRT_fail(ctx, "%s.next_check(): timer read failed: %s", VRT_fail(ctx, "%s.next_check(): timer read failed: %s",
rdr->obj_name, vstrerror(errno)); rdr->obj_name, VAS_errtxt(errno));
return (0.); return (0.);
} }
return (t.it_value.tv_sec + 1e-9 * t.it_value.tv_nsec); return (t.it_value.tv_sec + 1e-9 * t.it_value.tv_nsec);
...@@ -852,7 +852,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) ...@@ -852,7 +852,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
if (timer_gettime(rdr->timerid, &timer) != 0) { if (timer_gettime(rdr->timerid, &timer) != 0) {
VSB_printf(ctx->msg, VSB_printf(ctx->msg,
"vmod file: reading timer: %s", "vmod file: reading timer: %s",
vstrerror(errno)); VAS_errtxt(errno));
return (-1); return (-1);
} }
timer.it_value.tv_sec = 0; timer.it_value.tv_sec = 0;
...@@ -860,7 +860,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) ...@@ -860,7 +860,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
if (timer_settime(rdr->timerid, 0, &timer, NULL) != 0) { if (timer_settime(rdr->timerid, 0, &timer, NULL) != 0) {
VSB_printf(ctx->msg, VSB_printf(ctx->msg,
"vmod file: restarting timer: %s", "vmod file: restarting timer: %s",
vstrerror(errno)); VAS_errtxt(errno));
return (-1); return (-1);
} }
VSL(SLT_Debug, 0, "vmod file: %s.%s: timer restarted", VSL(SLT_Debug, 0, "vmod file: %s.%s: timer restarted",
...@@ -906,7 +906,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) ...@@ -906,7 +906,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
VSL(SLT_Error, 0, VSL(SLT_Error, 0,
"vmod file: %s.%s: reading timer: %s", "vmod file: %s.%s: reading timer: %s",
rdr->vcl_name, rdr->obj_name, rdr->vcl_name, rdr->obj_name,
vstrerror(errno)); VAS_errtxt(errno));
continue; continue;
} }
timer.it_value.tv_sec = 0; timer.it_value.tv_sec = 0;
...@@ -915,7 +915,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) ...@@ -915,7 +915,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
VSL(SLT_Error, 0, VSL(SLT_Error, 0,
"vmod file: %s.%s: suspending timer: %s", "vmod file: %s.%s: suspending timer: %s",
rdr->vcl_name, rdr->obj_name, rdr->vcl_name, rdr->obj_name,
vstrerror(errno)); VAS_errtxt(errno));
continue; continue;
} }
rdr->flags &= ~RDR_TIMER_INIT; rdr->flags &= ~RDR_TIMER_INIT;
...@@ -932,7 +932,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) ...@@ -932,7 +932,7 @@ VPFX(event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
VSL(SLT_Error, 0, VSL(SLT_Error, 0,
"vmod file: %s.%s: unmap failed: %s", "vmod file: %s.%s: unmap failed: %s",
rdr->vcl_name, rdr->obj_name, rdr->vcl_name, rdr->obj_name,
vstrerror(errno)); VAS_errtxt(errno));
continue; continue;
} }
rdr->flags &= ~RDR_MAPPED; rdr->flags &= ~RDR_MAPPED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment