summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2005-12-22 14:31:45 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2005-12-22 14:31:45 +0000
commitaf6a6829a6427182ad5cd5b6788a454e54625592 (patch)
tree880325d5d9b125e1bd9350756b000e31c1285b9f /usr.bin/cvs
parent02fccedca2601913a031fa41a6ba13d4777677f9 (diff)
cvs_chdir() cannot fail anymore;
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/release.c14
-rw-r--r--usr.bin/cvs/req.c11
-rw-r--r--usr.bin/cvs/util.c9
3 files changed, 12 insertions, 22 deletions
diff --git a/usr.bin/cvs/release.c b/usr.bin/cvs/release.c
index bce2e6012fc..73418748c1b 100644
--- a/usr.bin/cvs/release.c
+++ b/usr.bin/cvs/release.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: release.c,v 1.23 2005/10/07 21:47:32 reyk Exp $ */
+/* $OpenBSD: release.c,v 1.24 2005/12/22 14:31:44 xsa Exp $ */
/*
* Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
* All rights reserved.
@@ -161,8 +161,7 @@ cvs_release_dir(CVSFILE *cf, void *arg)
return (0);
/* chdir before running the `cvs update' command */
- if (cvs_chdir(dpath) == -1)
- return (CVS_EX_FILE);
+ cvs_chdir(dpath);
/* test if dir has CVS/ directory */
if (stat(CVS_PATH_CVSDIR, &st) == -1) {
@@ -200,8 +199,7 @@ cvs_release_dir(CVSFILE *cf, void *arg)
cvs_log(LP_ERR, "unable to release `%s'", dpath);
/* change back to original working dir */
- if (cvs_chdir(wdir) == -1)
- return (CVS_EX_FILE);
+ cvs_chdir(wdir);
}
printf("You have [%d] altered file%s in this repository.\n",
@@ -220,15 +218,13 @@ cvs_release_dir(CVSFILE *cf, void *arg)
"** `%s' aborted by user choice.\n", cvs_command);
/* change back to original working dir */
- if (cvs_chdir(wdir) == -1)
- return (CVS_EX_FILE);
+ cvs_chdir(wdir);
return (-1);
}
/* change back to original working dir */
- if (cvs_chdir(wdir) == -1)
- return (CVS_EX_FILE);
+ cvs_chdir(wdir);
if (dflag == 1) {
if (cvs_rmdir(dpath) != 0)
diff --git a/usr.bin/cvs/req.c b/usr.bin/cvs/req.c
index c977e70723a..35baf600d76 100644
--- a/usr.bin/cvs/req.c
+++ b/usr.bin/cvs/req.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: req.c,v 1.36 2005/12/21 20:04:36 xsa Exp $ */
+/* $OpenBSD: req.c,v 1.37 2005/12/22 14:31:44 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -282,8 +282,7 @@ cvs_req_directory(int reqid, char *line)
* Lets make sure we always start at the correct
* directory.
*/
- if (cvs_chdir(cvs_server_tmpdir) == -1)
- return (-1);
+ cvs_chdir(cvs_server_tmpdir);
/*
* Set repository path.
@@ -609,10 +608,8 @@ cvs_req_command(int reqid, char *line)
cvs_req_args[0] = cmdp->cmd_name;
/* switch to the correct directory */
- if (cmdp->cmd_op != CVS_OP_VERSION) {
- if (cvs_chdir(cvs_server_tmpdir) == -1)
- return (-1);
- }
+ if (cmdp->cmd_op != CVS_OP_VERSION)
+ cvs_chdir(cvs_server_tmpdir);
ret = cvs_startcmd(cmdp, cvs_req_nargs, cvs_req_args);
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c
index 863564ca274..1513008e468 100644
--- a/usr.bin/cvs/util.c
+++ b/usr.bin/cvs/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.60 2005/12/22 14:16:18 xsa Exp $ */
+/* $OpenBSD: util.c,v 1.61 2005/12/22 14:31:44 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -697,11 +697,8 @@ cvs_create_dir(const char *path, int create_adm, char *root, char *repo)
entf = NULL;
}
- /*
- * All went ok, switch to the newly created directory.
- */
- if (cvs_chdir(d) == -1)
- goto done;
+ /* All went ok, switch to the newly created directory. */
+ cvs_chdir(d);
d = strtok(NULL, "/");
}