From 2b13d70f1a07f04c738b10a08c370ae26e34563e Mon Sep 17 00:00:00 2001 From: Xavier Santolaria Date: Sat, 24 Dec 2005 19:07:53 +0000 Subject: 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@. --- usr.bin/cvs/release.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'usr.bin/cvs/release.c') 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 * 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) -- cgit v1.2.3