Deleted Added
full compact
pkg.c (263020) pkg.c (268896)
1/*-
2 * Copyright (c) 2012-2014 Baptiste Daroussin <bapt@FreeBSD.org>
3 * Copyright (c) 2013 Bryan Drewery <bdrewery@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012-2014 Baptiste Daroussin <bapt@FreeBSD.org>
3 * Copyright (c) 2013 Bryan Drewery <bdrewery@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: stable/10/usr.sbin/pkg/pkg.c 263020 2014-03-11 13:16:03Z bapt $");
29__FBSDID("$FreeBSD: stable/10/usr.sbin/pkg/pkg.c 268896 2014-07-19 23:44:57Z bapt $");
30
31#include <sys/param.h>
32#include <sys/queue.h>
33#include <sys/types.h>
34#include <sys/sbuf.h>
35#include <sys/wait.h>
36
37#define _WITH_GETLINE

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

268 fclose(remote);
269
270 return fd;
271}
272
273static struct fingerprint *
274parse_fingerprint(ucl_object_t *obj)
275{
30
31#include <sys/param.h>
32#include <sys/queue.h>
33#include <sys/types.h>
34#include <sys/sbuf.h>
35#include <sys/wait.h>
36
37#define _WITH_GETLINE

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

268 fclose(remote);
269
270 return fd;
271}
272
273static struct fingerprint *
274parse_fingerprint(ucl_object_t *obj)
275{
276 ucl_object_t *cur;
276 const ucl_object_t *cur;
277 ucl_object_iter_t it = NULL;
278 const char *function, *fp, *key;
279 struct fingerprint *f;
280 hash_t fct = HASH_UNKNOWN;
281
282 function = fp = NULL;
283
284 while ((cur = ucl_iterate_object(obj, &it, true))) {

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

348 obj = ucl_parser_get_object(p);
349
350 if (obj->type == UCL_OBJECT)
351 f = parse_fingerprint(obj);
352
353 if (f != NULL)
354 f->name = strdup(filename);
355
277 ucl_object_iter_t it = NULL;
278 const char *function, *fp, *key;
279 struct fingerprint *f;
280 hash_t fct = HASH_UNKNOWN;
281
282 function = fp = NULL;
283
284 while ((cur = ucl_iterate_object(obj, &it, true))) {

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

348 obj = ucl_parser_get_object(p);
349
350 if (obj->type == UCL_OBJECT)
351 f = parse_fingerprint(obj);
352
353 if (f != NULL)
354 f->name = strdup(filename);
355
356 ucl_object_free(obj);
356 ucl_object_unref(obj);
357 ucl_parser_free(p);
358
359 return (f);
360}
361
362static struct fingerprint_list *
363load_fingerprints(const char *path, int *count)
364{

--- 594 unchanged lines hidden ---
357 ucl_parser_free(p);
358
359 return (f);
360}
361
362static struct fingerprint_list *
363load_fingerprints(const char *path, int *count)
364{

--- 594 unchanged lines hidden ---