| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005. |
|---|
| 3 | | - * |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or |
|---|
| 6 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 7 | | - * published by the Free Software Foundation; either version 2 of the |
|---|
| 8 | | - * License, or (at your option) any later version. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 13 | | - * General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, write to the Free Software |
|---|
| 17 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|---|
| 18 | | - * USA |
|---|
| 19 | 4 | */ |
|---|
| 20 | 5 | |
|---|
| 21 | 6 | #include "dtc.h" |
|---|
| .. | .. |
|---|
| 34 | 19 | if (!d) |
|---|
| 35 | 20 | die("Couldn't opendir() \"%s\": %s\n", dirname, strerror(errno)); |
|---|
| 36 | 21 | |
|---|
| 37 | | - tree = build_node(NULL, NULL); |
|---|
| 22 | + tree = build_node(NULL, NULL, NULL); |
|---|
| 38 | 23 | |
|---|
| 39 | 24 | while ((de = readdir(d)) != NULL) { |
|---|
| 40 | 25 | char *tmpname; |
|---|
| .. | .. |
|---|
| 45 | 30 | |
|---|
| 46 | 31 | tmpname = join_path(dirname, de->d_name); |
|---|
| 47 | 32 | |
|---|
| 48 | | - if (lstat(tmpname, &st) < 0) |
|---|
| 33 | + if (stat(tmpname, &st) < 0) |
|---|
| 49 | 34 | die("stat(%s): %s\n", tmpname, strerror(errno)); |
|---|
| 50 | 35 | |
|---|
| 51 | 36 | if (S_ISREG(st.st_mode)) { |
|---|
| .. | .. |
|---|
| 60 | 45 | } else { |
|---|
| 61 | 46 | prop = build_property(xstrdup(de->d_name), |
|---|
| 62 | 47 | data_copy_file(pfile, |
|---|
| 63 | | - st.st_size)); |
|---|
| 48 | + st.st_size), |
|---|
| 49 | + NULL); |
|---|
| 64 | 50 | add_property(tree, prop); |
|---|
| 65 | 51 | fclose(pfile); |
|---|
| 66 | 52 | } |
|---|