hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/scripts/dtc/fstree.c
....@@ -1,21 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * (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
194 */
205
216 #include "dtc.h"
....@@ -34,7 +19,7 @@
3419 if (!d)
3520 die("Couldn't opendir() \"%s\": %s\n", dirname, strerror(errno));
3621
37
- tree = build_node(NULL, NULL);
22
+ tree = build_node(NULL, NULL, NULL);
3823
3924 while ((de = readdir(d)) != NULL) {
4025 char *tmpname;
....@@ -45,7 +30,7 @@
4530
4631 tmpname = join_path(dirname, de->d_name);
4732
48
- if (lstat(tmpname, &st) < 0)
33
+ if (stat(tmpname, &st) < 0)
4934 die("stat(%s): %s\n", tmpname, strerror(errno));
5035
5136 if (S_ISREG(st.st_mode)) {
....@@ -60,7 +45,8 @@
6045 } else {
6146 prop = build_property(xstrdup(de->d_name),
6247 data_copy_file(pfile,
63
- st.st_size));
48
+ st.st_size),
49
+ NULL);
6450 add_property(tree, prop);
6551 fclose(pfile);
6652 }