=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/util.c,v retrieving revision 1.62 retrieving revision 1.63 diff -c -r1.62 -r1.63 *** src/usr.bin/cvs/util.c 2005/12/24 04:10:51 1.62 --- src/usr.bin/cvs/util.c 2005/12/24 19:07:52 1.63 *************** *** 1,4 **** ! /* $OpenBSD: util.c,v 1.62 2005/12/24 04:10:51 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: util.c,v 1.63 2005/12/24 19:07:52 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 495,509 **** /* * cvs_chdir() * ! * Change to directory. ! * chdir() wrapper with an error message. * Returns 0 on success. */ int ! cvs_chdir(const char *path) { ! if (chdir(path) == -1) fatal("cvs_chdir: `%s': %s", path, strerror(errno)); return (0); } --- 495,513 ---- /* * cvs_chdir() * ! * Change to directory . ! * If is equal to `1', is removed if chdir() fails so we ! * do not have temporary directories leftovers. * Returns 0 on success. */ int ! cvs_chdir(const char *path, int rm) { ! if (chdir(path) == -1) { ! if (rm == 1) ! cvs_unlink(path); fatal("cvs_chdir: `%s': %s", path, strerror(errno)); + } return (0); } *************** *** 698,704 **** } /* All went ok, switch to the newly created directory. */ ! cvs_chdir(d); d = strtok(NULL, "/"); } --- 702,708 ---- } /* All went ok, switch to the newly created directory. */ ! cvs_chdir(d, 0); d = strtok(NULL, "/"); }