summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-04-26 15:08:26 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-04-26 15:08:26 +0000
commiteddf41e7862ea1cb91de12a93c993b66641c1ccf (patch)
tree65e1a49f2d74bbabe79e0fa2684439e683b2574a /usr.bin/rcs
parent94463e03d88ae72c3fb9ba2775f4a83ddf98af03 (diff)
err() cleanup;
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/buf.c10
-rw-r--r--usr.bin/rcs/diff.c4
-rw-r--r--usr.bin/rcs/rcs.c11
3 files changed, 12 insertions, 13 deletions
diff --git a/usr.bin/rcs/buf.c b/usr.bin/rcs/buf.c
index 4ba7fbb7a1b..4c4610de754 100644
--- a/usr.bin/rcs/buf.c
+++ b/usr.bin/rcs/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.2 2006/04/26 08:07:12 xsa Exp $ */
+/* $OpenBSD: buf.c,v 1.3 2006/04/26 15:08:25 xsa Exp $ */
/*
* Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -99,7 +99,7 @@ rcs_buf_load(const char *path, u_int flags)
}
if (fstat(fd, &st) == -1)
- err(1, "rcs_buf_load: fstat: %s", path);
+ err(1, "%s", path);
buf = rcs_buf_alloc((size_t)st.st_size, flags);
for (bp = buf->cb_cur; ; bp += (size_t)ret) {
@@ -107,7 +107,7 @@ rcs_buf_load(const char *path, u_int flags)
ret = read(fd, bp, len);
if (ret == -1) {
rcs_buf_free(buf);
- err(1, "rcs_buf_load: read: %s", strerror(errno));
+ err(1, "rcs_buf_load");
} else if (ret == 0)
break;
@@ -346,7 +346,7 @@ rcs_buf_write(BUF *b, const char *path, mode_t mode)
if (errno == EACCES && unlink(path) != -1)
goto open;
else
- err(1, "open: `%s'", path);
+ err(1, "%s", path);
}
if (rcs_buf_write_fd(b, fd) == -1) {
@@ -375,7 +375,7 @@ rcs_buf_write_stmp(BUF *b, char *template, mode_t mode)
int fd;
if ((fd = mkstemp(template)) == -1)
- err(1, "mkstemp: `%s'", template);
+ err(1, "%s", template);
rcs_worklist_add(template, &rcs_temp_files);
diff --git a/usr.bin/rcs/diff.c b/usr.bin/rcs/diff.c
index 5cf520c3bcf..6eecdd738c4 100644
--- a/usr.bin/rcs/diff.c
+++ b/usr.bin/rcs/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.1 2006/04/26 02:55:13 joris Exp $ */
+/* $OpenBSD: diff.c,v 1.2 2006/04/26 15:08:25 xsa Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
* All rights reserved.
@@ -1385,7 +1385,7 @@ diff_output(const char *fmt, ...)
i = vasprintf(&str, fmt, vap);
va_end(vap);
if (i == -1)
- err(1, "diff_output:");
+ err(1, "diff_output");
if (diffbuf != NULL)
rcs_buf_append(diffbuf, str, strlen(str));
else
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index 21f0ff6ce1d..4f24efce48b 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.1 2006/04/26 02:55:13 joris Exp $ */
+/* $OpenBSD: rcs.c,v 1.2 2006/04/26 15:08:25 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -399,12 +399,11 @@ rcs_write(RCSFILE *rfp)
strlcpy(fn, "/tmp/rcs.XXXXXXXXXX", sizeof(fn));
if ((fd = mkstemp(fn)) == -1)
- err(1, "mkstemp: `%s'", fn);
+ err(1, "%s", fn);
if ((fp = fdopen(fd, "w+")) == NULL) {
- fd = errno;
- unlink(fn);
- err(1, "fdopen: %s", fn);
+ (void)unlink(fn);
+ err(1, "%s", fn);
}
if (rfp->rf_head != NULL)
@@ -1733,7 +1732,7 @@ rcs_parse_init(RCSFILE *rfp)
pdp->rp_pttype = RCS_TOK_ERR;
if ((pdp->rp_file = fopen(rfp->rf_path, "r")) == NULL)
- err(1, "fopen: `%s'", rfp->rf_path);
+ err(1, "%s", rfp->rf_path);
pdp->rp_buf = xmalloc((size_t)RCS_BUFSIZE);
pdp->rp_blen = RCS_BUFSIZE;