"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/server/manios.c" between
burp-2.3.14.tar.bz2 and burp-2.3.20.tar.bz2

About: Burp is a backup and restore program using librsync and also VSS (for Windows clients). Latest version.

manios.c  (burp-2.3.14.tar.bz2):manios.c  (burp-2.3.20.tar.bz2)
#include "../burp.h" #include "../burp.h"
#include "../alloc.h" #include "../alloc.h"
#include "../fsops.h"
#include "../log.h"
#include "manios.h" #include "manios.h"
#include "manio.h" #include "manio.h"
static struct manios *manios_alloc(void) static struct manios *manios_alloc(void)
{ {
return (struct manios *)calloc_w(1, sizeof(struct manios), __func__); return (struct manios *)calloc_w(1, sizeof(struct manios), __func__);
} }
struct manios *manios_open_phase2(struct sdirs *sdirs, man_off_t *p1pos, struct manios *manios_open_phase2(
struct sdirs *sdirs,
man_off_t *pos_phase1,
man_off_t *pos_current,
enum protocol p) enum protocol p)
{ {
struct manios *m=NULL; struct manios *m=NULL;
if(!(m=manios_alloc()) if(!(m=manios_alloc())
|| !(m->current=manio_open(sdirs->cmanifest, "rb", p))
|| !(m->phase1=manio_open_phase1(sdirs->phase1data, "rb", p)) || !(m->phase1=manio_open_phase1(sdirs->phase1data, "rb", p))
|| !(m->changed=manio_open_phase2(sdirs->changed, "ab", p)) || !(m->changed=manio_open_phase2(sdirs->changed, "ab", p))
|| !(m->unchanged=manio_open_phase2(sdirs->unchanged, "ab", p)) || !(m->unchanged=manio_open_phase2(sdirs->unchanged, "ab", p))
|| (p1pos && manio_seek(m->phase1, p1pos))) // The counters are always flat files, which is given by PROTO_1.
manios_close(&m); || !(m->counters_d=manio_open_phase2(
sdirs->counters_d, "ab", PROTO_1))
|| !(m->counters_n=manio_open_phase2(
sdirs->counters_n, "ab", PROTO_1))
|| (pos_phase1 && manio_seek(m->phase1, pos_phase1)))
goto error;
if(!(m->current=manio_open(sdirs->cmanifest, "rb", p)))
logp("Want to seek but could not open %s\n",
goto error;
if(p==PROTO_1 && is_reg_lstat(sdirs->cmanifest)==1)
logp("Could not open %s\n", sdirs->cmanifest);
goto error;
if(p==PROTO_2 && is_dir_lstat(sdirs->cmanifest)==1)
logp("Could not open dir %s\n", sdirs->cmanifest);
goto error;
if(pos_current && manio_seek(m->current, pos_current))
goto error;
return m; return m;
return NULL;
} }
int manios_close(struct manios **manios) int manios_close(struct manios **manios)
{ {
int ret=0; int ret=0;
if(!manios || !*manios) return 0; if(!manios || !*manios) return 0;
ret|=manio_close(&(*manios)->current); ret|=manio_close(&(*manios)->current);
ret|=manio_close(&(*manios)->phase1); ret|=manio_close(&(*manios)->phase1);
ret|=manio_close(&(*manios)->changed); ret|=manio_close(&(*manios)->changed);
ret|=manio_close(&(*manios)->unchanged); ret|=manio_close(&(*manios)->unchanged);
free_v((void **)manios); free_v((void **)manios);
return ret; return ret;
} }
 End of changes. 7 change blocks. 
4 lines changed or deleted 42 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)