diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2006-03-20 16:18:14 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2006-03-20 16:18:14 +0000 |
commit | 476bf8f7fcedcb4bc23b900715716f3fac897fdb (patch) | |
tree | 0853b8ff04059c83bfb8c1fe1cbb6f706e4558fc /usr.bin | |
parent | de50169127deba14884eaef1d8cb8c81f01abf41 (diff) |
delint; cvs_buf_write_stmp() will never return non-zero:
- remove superfluous error handling for cvs_buf_write_stmp()
- change cvs_buf_write_stmp() return type to void
ok joris@ xsa@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/buf.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/buf.h | 4 | ||||
-rw-r--r-- | usr.bin/rcs/ci.c | 8 | ||||
-rw-r--r-- | usr.bin/rcs/rcsdiff.c | 14 |
4 files changed, 12 insertions, 20 deletions
diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c index d2d67d3cadb..5933a9b51ca 100644 --- a/usr.bin/cvs/buf.c +++ b/usr.bin/cvs/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.37 2006/03/17 07:37:08 ray Exp $ */ +/* $OpenBSD: buf.c,v 1.38 2006/03/20 16:18:13 niallo Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -404,7 +404,7 @@ cvs_buf_write(BUF *b, const char *path, mode_t mode) * specified using <template> (see mkstemp.3). NB. This function will modify * <template>, as per mkstemp */ -int +void cvs_buf_write_stmp(BUF *b, char *template, mode_t mode) { int fd; @@ -418,8 +418,6 @@ cvs_buf_write_stmp(BUF *b, char *template, mode_t mode) } (void)fchmod(fd, mode); (void)close(fd); - - return (0); } /* diff --git a/usr.bin/cvs/buf.h b/usr.bin/cvs/buf.h index c5feec02b2a..523805fc62f 100644 --- a/usr.bin/cvs/buf.h +++ b/usr.bin/cvs/buf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.h,v 1.10 2006/03/17 07:37:08 ray Exp $ */ +/* $OpenBSD: buf.h,v 1.11 2006/03/20 16:18:13 niallo Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -61,7 +61,7 @@ size_t cvs_buf_len(BUF *); const void *cvs_buf_peek(BUF *, size_t); int cvs_buf_write_fd(BUF *, int); int cvs_buf_write(BUF *, const char *, mode_t); -int cvs_buf_write_stmp(BUF *, char *, mode_t); +void cvs_buf_write_stmp(BUF *, char *, mode_t); #define cvs_buf_get(b) cvs_buf_peek(b, 0) diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index e9e382f46a8..4ac206fa4d2 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.122 2006/03/17 07:32:03 ray Exp $ */ +/* $OpenBSD: ci.c,v 1.123 2006/03/20 16:18:13 niallo Exp $ */ /* * Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -323,8 +323,7 @@ checkin_diff_file(struct checkin_params *pb) strlcpy(path1, rcs_tmpdir, sizeof(path1)); strlcat(path1, "/diff1.XXXXXXXXXX", sizeof(path1)); - if (cvs_buf_write_stmp(b1, path1, 0600) == -1) - goto out; + cvs_buf_write_stmp(b1, path1, 0600); cvs_worklist_add(path1, &rcs_temp_files); cvs_buf_free(b1); @@ -332,8 +331,7 @@ checkin_diff_file(struct checkin_params *pb) strlcpy(path2, rcs_tmpdir, sizeof(path2)); strlcat(path2, "/diff2.XXXXXXXXXX", sizeof(path2)); - if (cvs_buf_write_stmp(b2, path2, 0600) == -1) - goto out; + cvs_buf_write_stmp(b2, path2, 0600); cvs_worklist_add(path2, &rcs_temp_files); cvs_buf_free(b2); diff --git a/usr.bin/rcs/rcsdiff.c b/usr.bin/rcs/rcsdiff.c index 3bb100b8244..6b5edb48943 100644 --- a/usr.bin/rcs/rcsdiff.c +++ b/usr.bin/rcs/rcsdiff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsdiff.c,v 1.39 2006/03/16 04:04:57 ray Exp $ */ +/* $OpenBSD: rcsdiff.c,v 1.40 2006/03/20 16:18:13 niallo Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -208,8 +208,7 @@ rcsdiff_file(RCSFILE *file, RCSNUM *rev, const char *filename) strlcpy(path1, rcs_tmpdir, sizeof(path1)); strlcat(path1, "/diff1.XXXXXXXXXX", sizeof(path1)); - if (cvs_buf_write_stmp(b1, path1, 0600) == -1) - goto out; + cvs_buf_write_stmp(b1, path1, 0600); cvs_worklist_add(path1, &rcs_temp_files); cvs_buf_free(b1); @@ -220,8 +219,7 @@ rcsdiff_file(RCSFILE *file, RCSNUM *rev, const char *filename) strlcpy(path2, rcs_tmpdir, sizeof(path2)); strlcat(path2, "/diff2.XXXXXXXXXX", sizeof(path2)); - if (cvs_buf_write_stmp(b2, path2, 0600) == -1) - goto out; + cvs_buf_write_stmp(b2, path2, 0600); cvs_worklist_add(path2, &rcs_temp_files); cvs_buf_free(b2); @@ -289,8 +287,7 @@ rcsdiff_rev(RCSFILE *file, RCSNUM *rev1, RCSNUM *rev2) strlcpy(path1, rcs_tmpdir, sizeof(path1)); strlcat(path1, "/diff1.XXXXXXXXXX", sizeof(path1)); - if (cvs_buf_write_stmp(b1, path1, 0600) == -1) - goto out; + cvs_buf_write_stmp(b1, path1, 0600); cvs_worklist_add(path1, &rcs_temp_files); cvs_buf_free(b1); @@ -301,8 +298,7 @@ rcsdiff_rev(RCSFILE *file, RCSNUM *rev1, RCSNUM *rev2) strlcpy(path2, rcs_tmpdir, sizeof(path2)); strlcat(path2, "/diff2.XXXXXXXXXX", sizeof(path2)); - if (cvs_buf_write_stmp(b2, path2, 0600) == -1) - goto out; + cvs_buf_write_stmp(b2, path2, 0600); cvs_worklist_add(path2, &rcs_temp_files); cvs_buf_free(b2); |