Deleted Added
full compact
check.c (240120) check.c (273929)
1/*
2 * Automated Testing Framework (atf)
3 *
4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
1/* Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright

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

19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright

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

16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
20 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
24 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29
25
26#include "atf-c/check.h"
27
30#include <sys/wait.h>
31
32#include <errno.h>
33#include <fcntl.h>
34#include <stdio.h>
35#include <stdlib.h>
36#include <string.h>
37#include <unistd.h>
38
39#include "atf-c/build.h"
28#include <sys/wait.h>
29
30#include <errno.h>
31#include <fcntl.h>
32#include <stdio.h>
33#include <stdlib.h>
34#include <string.h>
35#include <unistd.h>
36
37#include "atf-c/build.h"
40#include "atf-c/check.h"
41#include "atf-c/config.h"
42#include "atf-c/defs.h"
38#include "atf-c/defs.h"
39#include "atf-c/detail/dynstr.h"
40#include "atf-c/detail/env.h"
41#include "atf-c/detail/fs.h"
42#include "atf-c/detail/list.h"
43#include "atf-c/detail/process.h"
44#include "atf-c/detail/sanity.h"
43#include "atf-c/error.h"
44#include "atf-c/utils.h"
45
45#include "atf-c/error.h"
46#include "atf-c/utils.h"
47
46#include "detail/dynstr.h"
47#include "detail/fs.h"
48#include "detail/list.h"
49#include "detail/process.h"
50#include "detail/sanity.h"
51
52/* ---------------------------------------------------------------------
53 * Auxiliary functions.
54 * --------------------------------------------------------------------- */
55
56static
57atf_error_t
58create_tmpdir(atf_fs_path_t *dir)
59{
60 atf_error_t err;
61
62 err = atf_fs_path_init_fmt(dir, "%s/check.XXXXXX",
48/* ---------------------------------------------------------------------
49 * Auxiliary functions.
50 * --------------------------------------------------------------------- */
51
52static
53atf_error_t
54create_tmpdir(atf_fs_path_t *dir)
55{
56 atf_error_t err;
57
58 err = atf_fs_path_init_fmt(dir, "%s/check.XXXXXX",
63 atf_config_get("atf_workdir"));
59 atf_env_get_with_default("TMPDIR", "/tmp"));
64 if (atf_is_error(err))
65 goto out;
66
67 err = atf_fs_mkdtemp(dir);
68 if (atf_is_error(err)) {
69 atf_fs_path_fini(dir);
70 goto out;
71 }

--- 417 unchanged lines hidden ---
60 if (atf_is_error(err))
61 goto out;
62
63 err = atf_fs_mkdtemp(dir);
64 if (atf_is_error(err)) {
65 atf_fs_path_fini(dir);
66 goto out;
67 }

--- 417 unchanged lines hidden ---