diff options
author | Ulf Lilleengen <lulf@FreeBSD.org> | 2008-11-19 14:57:00 +0000 |
---|---|---|
committer | Ulf Lilleengen <lulf@FreeBSD.org> | 2008-11-19 14:57:00 +0000 |
commit | d0d1701140e884d55f287930864cf865f02073b5 (patch) | |
tree | 0b21b52c8165dcd04fd5efcec776a74544e6b15c /contrib/csup/updater.c | |
parent | a02596e2f78dd9c3479fab7f3ab05bb75e6e89bd (diff) |
Notes
Diffstat (limited to 'contrib/csup/updater.c')
-rw-r--r-- | contrib/csup/updater.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/csup/updater.c b/contrib/csup/updater.c index 69526953c51e..8ae043ed85d4 100644 --- a/contrib/csup/updater.c +++ b/contrib/csup/updater.c @@ -615,12 +615,12 @@ updater_docoll(struct updater *up, struct file_update *fup, int isfixups) error = fup_prepare(fup, name, 0); if (error) return (UPDATER_ERR_PROTO); - sr->sr_type = SR_FILELIVE; fup->wantmd5 = xstrdup(wantmd5); fup->temppath = tempname(fup->destpath); sr = &fup->srbuf; sr->sr_file = xstrdup(name); sr->sr_serverattr = fattr_decode(attr); + sr->sr_type = SR_FILELIVE; if (sr->sr_serverattr == NULL) return (UPDATER_ERR_PROTO); error = updater_rsync(up, fup, strtol(blocksize, NULL, @@ -1841,8 +1841,10 @@ updater_addelta(struct rcsfile *rf, struct stream *rd, char *cmdline) /* First add the delta so we have it. */ d = rcsfile_addelta(rf, revnum, revdate, author, diffbase); - if (d == NULL) - err(1, "Error adding delta %s\n", revnum); + if (d == NULL) { + lprintf(-1, "Error adding delta %s\n", revnum); + return (UPDATER_ERR_READ); + } while ((line = stream_getln(rd, NULL)) != NULL) { if (strcmp(line, ".") == 0) break; @@ -2077,7 +2079,6 @@ updater_rsync(struct updater *up, struct file_update *fup, size_t blocksize) goto bad; /* Read blocks from original file. */ lseek(orig, SEEK_SET, (blocksize * blockstart)); - blocknum = 0; error = UPDATER_ERR_MSG; for (blocknum = 0; blocknum < blockcount; blocknum++) { nbytes = read(orig, buf, blocksize); |