diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-12-24 19:07:53 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-12-24 19:07:53 +0000 |
commit | 2b13d70f1a07f04c738b10a08c370ae26e34563e (patch) | |
tree | 78a7826d60f3195ceca44305d9a00a5e647f5f38 /usr.bin/cvs/release.c | |
parent | 2a5186542c0004c0dc3aecc03c9fca5308018e01 (diff) |
add an argument to cvs_chdir() which enables or not the removal
of the directory we just chdir'd to.
Useful when the function fails especially for the server mode and
its temporary directory. This way it's not left behind on exit.
ok joris@.
Diffstat (limited to 'usr.bin/cvs/release.c')
-rw-r--r-- | usr.bin/cvs/release.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/cvs/release.c b/usr.bin/cvs/release.c index 73418748c1b..9c419ba3d1a 100644 --- a/usr.bin/cvs/release.c +++ b/usr.bin/cvs/release.c @@ -1,4 +1,4 @@ -/* $OpenBSD: release.c,v 1.24 2005/12/22 14:31:44 xsa Exp $ */ +/* $OpenBSD: release.c,v 1.25 2005/12/24 19:07:52 xsa Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> * All rights reserved. @@ -161,7 +161,7 @@ cvs_release_dir(CVSFILE *cf, void *arg) return (0); /* chdir before running the `cvs update' command */ - cvs_chdir(dpath); + cvs_chdir(dpath, 0); /* test if dir has CVS/ directory */ if (stat(CVS_PATH_CVSDIR, &st) == -1) { @@ -199,7 +199,7 @@ cvs_release_dir(CVSFILE *cf, void *arg) cvs_log(LP_ERR, "unable to release `%s'", dpath); /* change back to original working dir */ - cvs_chdir(wdir); + cvs_chdir(wdir, 0); } printf("You have [%d] altered file%s in this repository.\n", @@ -218,13 +218,13 @@ cvs_release_dir(CVSFILE *cf, void *arg) "** `%s' aborted by user choice.\n", cvs_command); /* change back to original working dir */ - cvs_chdir(wdir); + cvs_chdir(wdir, 0); return (-1); } /* change back to original working dir */ - cvs_chdir(wdir); + cvs_chdir(wdir, 0); if (dflag == 1) { if (cvs_rmdir(dpath) != 0) |