=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/Attic/resp.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/usr.bin/cvs/Attic/resp.c 2004/12/06 21:03:12 1.11 --- src/usr.bin/cvs/Attic/resp.c 2004/12/07 16:48:55 1.12 *************** *** 1,4 **** ! /* $OpenBSD: resp.c,v 1.11 2004/12/06 21:03:12 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: resp.c,v 1.12 2004/12/07 16:48:55 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 124,130 **** static char *cvs_mt_stack[CVS_MTSTK_MAXDEPTH]; static u_int cvs_mtstk_depth = 0; ! static time_t cvs_modtime = 0; /* last checksum received */ --- 124,130 ---- static char *cvs_mt_stack[CVS_MTSTK_MAXDEPTH]; static u_int cvs_mtstk_depth = 0; ! static time_t cvs_modtime = CVS_DATE_DMSEC; /* last checksum received */ *************** *** 519,524 **** --- 519,525 ---- char path[MAXPATHLEN], cksum_buf[CVS_CKSUM_LEN]; BUF *fbuf; CVSFILE *cf; + CVSENTRIES *entfile; struct cvs_ent *ep; struct timeval tv[2]; *************** *** 543,554 **** return (-1); snprintf(path, sizeof(path), "%s/%s", line, ep->ce_name); if (type == CVS_RESP_CREATED) { /* set the timestamp as the last one received from Mod-time */ ep->ce_mtime = cvs_modtime; ! cvs_ent_add(cf->cf_ddat->cd_ent, ep); ! } else if (type == CVS_RESP_UPDEXIST) { ! } else if (type == CVS_RESP_UPDATED) { } fbuf = cvs_recvfile(root, &fmode); --- 544,566 ---- return (-1); snprintf(path, sizeof(path), "%s/%s", line, ep->ce_name); + entfile = cvs_ent_open(line, O_WRONLY); + if (entfile == NULL) { + cvs_ent_free(ep); + return (-1); + } + if (type == CVS_RESP_CREATED) { /* set the timestamp as the last one received from Mod-time */ ep->ce_mtime = cvs_modtime; ! cvs_ent_add(entfile, ep); ! } else if ((type == CVS_RESP_UPDEXIST) || (type == CVS_RESP_UPDATED)) { ! if (cvs_ent_remove(entfile, ep->ce_name) < 0) ! cvs_log(LP_WARN, "failed to remove entry for `%s'", ! ep->ce_name); ! ! cvs_ent_add(entfile, ep); ! } else if (type == CVS_RESP_MERGED) { } fbuf = cvs_recvfile(root, &fmode); *************** *** 557,568 **** cvs_buf_write(fbuf, path, fmode); ! tv[0].tv_sec = (long)cvs_modtime; ! tv[0].tv_usec = 0; ! tv[1].tv_sec = (long)cvs_modtime; ! tv[1].tv_usec = 0; ! if (utimes(path, tv) == -1) ! cvs_log(LP_ERRNO, "failed to set file timestamps"); /* now see if there is a checksum */ if (cvs_fcksum != NULL) { --- 569,582 ---- cvs_buf_write(fbuf, path, fmode); ! if (cvs_modtime != CVS_DATE_DMSEC) { ! tv[0].tv_sec = (long)cvs_modtime; ! tv[0].tv_usec = 0; ! tv[1].tv_sec = (long)cvs_modtime; ! tv[1].tv_usec = 0; ! if (utimes(path, tv) == -1) ! cvs_log(LP_ERRNO, "failed to set file timestamps"); ! } /* now see if there is a checksum */ if (cvs_fcksum != NULL) { *************** *** 627,632 **** --- 641,647 ---- cvs_resp_mode(struct cvsroot *root, int type, char *line) { if (cvs_strtomode(line, &cvs_lastmode) < 0) { + cvs_log(LP_ERR, "error handling Mode response"); return (-1); } return (0);