diff options
author | Junio C Hamano <junkio@cox.net> | 2005-11-05 11:50:24 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-11-05 11:50:24 -0800 |
commit | 87ce294c9129879f717f8749cae1c659e18a3823 (patch) | |
tree | 7bda83efef0ee677e4e743954bc00bdcf6a63874 /init-db.c | |
parent | 6ddc0964034342519a87fe013781abf31c6db6ad (diff) | |
parent | 3d95bf074e8532fd0643b886422eddd0768a3f2c (diff) |
GIT 0.99.9dv0.99.9d
This is primarily to include the 'git clone -l' (without -s) fix,
first spotted and diagnosed by Linus and caused James Bottomley's
repository to become unreadable. It also contains documentation
updates happened on the "master" branch since 0.99.9c
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'init-db.c')
-rw-r--r-- | init-db.c | 27 |
1 files changed, 3 insertions, 24 deletions
@@ -21,7 +21,7 @@ static void safe_create_dir(const char *dir) static int copy_file(const char *dst, const char *src, int mode) { - int fdi, fdo; + int fdi, fdo, status; mode = (mode & 0111) ? 0777 : 0666; if ((fdi = open(src, O_RDONLY)) < 0) @@ -30,30 +30,9 @@ static int copy_file(const char *dst, const char *src, int mode) close(fdi); return fdo; } - while (1) { - char buf[BUFSIZ]; - ssize_t leni, leno, ofs; - leni = read(fdi, buf, sizeof(buf)); - if (leni < 0) { - error_return: - close(fdo); - close(fdi); - return -1; - } - if (!leni) - break; - ofs = 0; - do { - leno = write(fdo, buf+ofs, leni); - if (leno < 0) - goto error_return; - leni -= leno; - ofs += leno; - } while (0 < leni); - } + status = copy_fd(fdi, fdo); close(fdo); - close(fdi); - return 0; + return status; } static void copy_templates_1(char *path, int baselen, |