Deleted Added
full compact
rcorder.c (154465) rcorder.c (158759)
1# if 0
2/* $NetBSD: rcorder.c,v 1.7 2000/08/04 07:33:55 enami Exp $ */
3#endif
4
5/*
6 * Copyright (c) 1998, 1999 Matthew R. Green
7 * All rights reserved.
8 * Copyright (c) 1998

--- 22 unchanged lines hidden (view full) ---

31 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#include <sys/types.h>
1# if 0
2/* $NetBSD: rcorder.c,v 1.7 2000/08/04 07:33:55 enami Exp $ */
3#endif
4
5/*
6 * Copyright (c) 1998, 1999 Matthew R. Green
7 * All rights reserved.
8 * Copyright (c) 1998

--- 22 unchanged lines hidden (view full) ---

31 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#include <sys/types.h>
39__FBSDID("$FreeBSD: head/sbin/rcorder/rcorder.c 154465 2006-01-17 08:01:00Z dougb $");
39__FBSDID("$FreeBSD: head/sbin/rcorder/rcorder.c 158759 2006-05-20 05:47:18Z delphij $");
40
41#include <sys/stat.h>
42
43#include <err.h>
44#include <stdio.h>
45#include <stdlib.h>
46#include <string.h>
47#include <unistd.h>

--- 669 unchanged lines hidden (view full) ---

717 return (!keep_list);
718}
719
720/*
721 * given a filenode, we ensure we are not a cyclic graph. if this
722 * is ok, we loop over the filenodes requirements, calling satisfy_req()
723 * for each of them.. once we have done this, remove this filenode
724 * from each provision table, as we are now done.
40
41#include <sys/stat.h>
42
43#include <err.h>
44#include <stdio.h>
45#include <stdlib.h>
46#include <string.h>
47#include <unistd.h>

--- 669 unchanged lines hidden (view full) ---

717 return (!keep_list);
718}
719
720/*
721 * given a filenode, we ensure we are not a cyclic graph. if this
722 * is ok, we loop over the filenodes requirements, calling satisfy_req()
723 * for each of them.. once we have done this, remove this filenode
724 * from each provision table, as we are now done.
725 *
726 * NOTE: do_file() is called recursively from several places and cannot
727 * safely free() anything related to items that may be recursed on.
728 * Circular dependancies will cause problems if we do.
725 */
726void
727do_file(fnode)
728 filenode *fnode;
729{
730 f_reqnode *r, *r_tmp;
731 f_provnode *p, *p_tmp;
732 provnode *pnode;

--- 19 unchanged lines hidden (view full) ---

752 * for each requirement of fnode -> r
753 * satisfy_req(r, filename)
754 */
755 r = fnode->req_list;
756 while (r != NULL) {
757 r_tmp = r;
758 satisfy_req(r, fnode->filename);
759 r = r->next;
729 */
730void
731do_file(fnode)
732 filenode *fnode;
733{
734 f_reqnode *r, *r_tmp;
735 f_provnode *p, *p_tmp;
736 provnode *pnode;

--- 19 unchanged lines hidden (view full) ---

756 * for each requirement of fnode -> r
757 * satisfy_req(r, filename)
758 */
759 r = fnode->req_list;
760 while (r != NULL) {
761 r_tmp = r;
762 satisfy_req(r, fnode->filename);
763 r = r->next;
764#if 0
760 if (was_set == 0)
765 if (was_set == 0)
761 free(r_tmp);
766 free(r_tmp);
767#endif
762 }
763 fnode->req_list = NULL;
764
765 /*
766 * for each provision of fnode -> p
767 * remove fnode from provision list for p in hash table
768 */
769 p = fnode->prov_list;

--- 22 unchanged lines hidden (view full) ---

792 if (fnode->next != NULL) {
793 fnode->next->last = fnode->last;
794 }
795 if (fnode->last != NULL) {
796 fnode->last->next = fnode->next;
797 }
798
799 DPRINTF((stderr, "nuking %s\n", fnode->filename));
768 }
769 fnode->req_list = NULL;
770
771 /*
772 * for each provision of fnode -> p
773 * remove fnode from provision list for p in hash table
774 */
775 p = fnode->prov_list;

--- 22 unchanged lines hidden (view full) ---

798 if (fnode->next != NULL) {
799 fnode->next->last = fnode->last;
800 }
801 if (fnode->last != NULL) {
802 fnode->last->next = fnode->next;
803 }
804
805 DPRINTF((stderr, "nuking %s\n", fnode->filename));
806#if 0
800 if (was_set == 0) {
801 free(fnode->filename);
802 free(fnode);
803 }
807 if (was_set == 0) {
808 free(fnode->filename);
809 free(fnode);
810 }
811#endif
804}
805
806void
807generate_ordering()
808{
809
810 /*
811 * while there remain undone files{f},

--- 17 unchanged lines hidden ---
812}
813
814void
815generate_ordering()
816{
817
818 /*
819 * while there remain undone files{f},

--- 17 unchanged lines hidden ---