mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'kbuild-v6.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada:
"This is the last pull request from me.
I'm grateful to have been able to continue as a maintainer for eight
years. From the next cycle, Nathan and Nicolas will maintain Kbuild.
- Fix a shortcut key issue in menuconfig
- Fix missing rebuild of kheaders
- Sort the symbol dump generated by gendwarfsyms
- Support zboot extraction in scripts/extract-vmlinux
- Migrate gconfig to GTK 3
- Add TAR variable to allow overriding the default tar command
- Hand over Kbuild maintainership"
* tag 'kbuild-v6.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (92 commits)
MAINTAINERS: hand over Kbuild maintenance
kheaders: make it possible to override TAR
kbuild: userprogs: use correct linker when mixing clang and GNU ld
kconfig: lxdialog: replace strcpy() with strncpy() in inputbox.c
kconfig: lxdialog: replace strcpy with snprintf in print_autowrap
kconfig: gconf: refactor text_insert_help()
kconfig: gconf: remove unneeded variable in text_insert_msg
kconfig: gconf: use hyphens in signals
kconfig: gconf: replace GtkImageMenuItem with GtkMenuItem
kconfig: gconf: Fix Back button behavior
kconfig: gconf: fix single view to display dependent symbols correctly
scripts: add zboot support to extract-vmlinux
gendwarfksyms: order -T symtypes output by name
gendwarfksyms: use preferred form of sizeof for allocation
kconfig: qconf: confine {begin,end}Group to constructor and destructor
kconfig: qconf: fix ConfigList::updateListAllforAll()
kconfig: add a function to dump all menu entries in a tree-like format
kconfig: gconf: show GTK version in About dialog
kconfig: gconf: replace GtkHPaned and GtkVPaned with GtkPaned
kconfig: gconf: replace GdkColor with GdkRGBA
...
This commit is contained in:
@@ -4378,6 +4378,12 @@ S: 542 West 112th Street, 5N
|
||||
S: New York, New York 10025
|
||||
S: USA
|
||||
|
||||
N: Masahiro Yamada
|
||||
E: masahiroy@kernel.org
|
||||
D: Kbuild Maintainer 2017-2025
|
||||
D: Kconfig Maintainer 2018-2025
|
||||
S: Japan
|
||||
|
||||
N: Li Yang
|
||||
E: leoli@freescale.com
|
||||
D: Freescale Highspeed USB device driver
|
||||
|
||||
@@ -67,12 +67,12 @@ Environment variables for ``*config``:
|
||||
with its value when saving the configuration, instead of using the
|
||||
default, ``CONFIG_``.
|
||||
|
||||
Environment variables for ``{allyes/allmod/allno/rand}config``:
|
||||
Environment variables for ``{allyes/allmod/allno/alldef/rand}config``:
|
||||
|
||||
``KCONFIG_ALLCONFIG``
|
||||
The allyesconfig/allmodconfig/allnoconfig/randconfig variants can also
|
||||
use the environment variable KCONFIG_ALLCONFIG as a flag or a filename
|
||||
that contains config symbols that the user requires to be set to a
|
||||
The allyesconfig/allmodconfig/alldefconfig/allnoconfig/randconfig variants
|
||||
can also use the environment variable KCONFIG_ALLCONFIG as a flag or a
|
||||
filename that contains config symbols that the user requires to be set to a
|
||||
specific value. If KCONFIG_ALLCONFIG is used without a filename where
|
||||
KCONFIG_ALLCONFIG == "" or KCONFIG_ALLCONFIG == "1", ``make *config``
|
||||
checks for a file named "all{yes/mod/no/def/random}.config"
|
||||
|
||||
+5
-8
@@ -13174,11 +13174,9 @@ F: mm/kasan/
|
||||
F: scripts/Makefile.kasan
|
||||
|
||||
KCONFIG
|
||||
M: Masahiro Yamada <masahiroy@kernel.org>
|
||||
L: linux-kbuild@vger.kernel.org
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
Q: https://patchwork.kernel.org/project/linux-kbuild/list/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild
|
||||
F: Documentation/kbuild/kconfig*
|
||||
F: scripts/Kconfig.include
|
||||
F: scripts/kconfig/
|
||||
@@ -13243,13 +13241,12 @@ S: Maintained
|
||||
F: fs/autofs/
|
||||
|
||||
KERNEL BUILD + files below scripts/ (unless maintained elsewhere)
|
||||
M: Masahiro Yamada <masahiroy@kernel.org>
|
||||
R: Nathan Chancellor <nathan@kernel.org>
|
||||
R: Nicolas Schier <nicolas@fjasle.eu>
|
||||
M: Nathan Chancellor <nathan@kernel.org>
|
||||
M: Nicolas Schier <nicolas@fjasle.eu>
|
||||
L: linux-kbuild@vger.kernel.org
|
||||
S: Maintained
|
||||
S: Odd Fixes
|
||||
Q: https://patchwork.kernel.org/project/linux-kbuild/list/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git
|
||||
F: Documentation/kbuild/
|
||||
F: Makefile
|
||||
F: scripts/*vmlinux*
|
||||
|
||||
@@ -549,6 +549,7 @@ LZMA = lzma
|
||||
LZ4 = lz4
|
||||
XZ = xz
|
||||
ZSTD = zstd
|
||||
TAR = tar
|
||||
|
||||
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
||||
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
|
||||
@@ -628,7 +629,7 @@ export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN
|
||||
export HOSTRUSTC KBUILD_HOSTRUSTFLAGS
|
||||
export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
|
||||
export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
||||
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
|
||||
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD TAR
|
||||
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS KBUILD_PROCMACROLDFLAGS LDFLAGS_MODULE
|
||||
export KBUILD_USERCFLAGS KBUILD_USERLDFLAGS
|
||||
|
||||
@@ -1141,7 +1142,7 @@ KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD
|
||||
KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
|
||||
|
||||
# userspace programs are linked via the compiler, use the correct linker
|
||||
ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_LD_IS_LLD),yy)
|
||||
ifdef CONFIG_CC_IS_CLANG
|
||||
KBUILD_USERLDFLAGS += --ld-path=$(LD)
|
||||
endif
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
* alias.
|
||||
*/
|
||||
#define MODULE_ALIAS_CRYPTO(name) \
|
||||
__MODULE_INFO(alias, alias_userspace, name); \
|
||||
__MODULE_INFO(alias, alias_crypto, "crypto-" name)
|
||||
MODULE_INFO(alias, name); \
|
||||
MODULE_INFO(alias, "crypto-" name)
|
||||
|
||||
struct crypto_aead;
|
||||
struct crypto_instance;
|
||||
|
||||
@@ -165,9 +165,6 @@ extern void cleanup_module(void);
|
||||
|
||||
struct module_kobject *lookup_or_create_module_kobject(const char *name);
|
||||
|
||||
/* Generic info of form tag = "info" */
|
||||
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
|
||||
|
||||
/* For userspace: you can also call me... */
|
||||
#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
|
||||
|
||||
|
||||
@@ -24,18 +24,19 @@
|
||||
#define __MODULE_INFO_PREFIX KBUILD_MODNAME "."
|
||||
#endif
|
||||
|
||||
#define __MODULE_INFO(tag, name, info) \
|
||||
static const char __UNIQUE_ID(name)[] \
|
||||
/* Generic info of form tag = "info" */
|
||||
#define MODULE_INFO(tag, info) \
|
||||
static const char __UNIQUE_ID(modinfo)[] \
|
||||
__used __section(".modinfo") __aligned(1) \
|
||||
= __MODULE_INFO_PREFIX __stringify(tag) "=" info
|
||||
|
||||
#define __MODULE_PARM_TYPE(name, _type) \
|
||||
__MODULE_INFO(parmtype, name##type, #name ":" _type)
|
||||
MODULE_INFO(parmtype, #name ":" _type)
|
||||
|
||||
/* One for each parameter, describing how to use it. Some files do
|
||||
multiple of these per line, so can't just use MODULE_INFO. */
|
||||
#define MODULE_PARM_DESC(_parm, desc) \
|
||||
__MODULE_INFO(parm, _parm, #_parm ":" desc)
|
||||
MODULE_INFO(parm, #_parm ":" desc)
|
||||
|
||||
struct kernel_param;
|
||||
|
||||
|
||||
+2
-2
@@ -2655,8 +2655,8 @@ void tcp_update_ulp(struct sock *sk, struct proto *p,
|
||||
void (*write_space)(struct sock *sk));
|
||||
|
||||
#define MODULE_ALIAS_TCP_ULP(name) \
|
||||
__MODULE_INFO(alias, alias_userspace, name); \
|
||||
__MODULE_INFO(alias, alias_tcp_ulp, "tcp-ulp-" name)
|
||||
MODULE_INFO(alias, name); \
|
||||
MODULE_INFO(alias, "tcp-ulp-" name)
|
||||
|
||||
#ifdef CONFIG_NET_SOCK_MSG
|
||||
struct sk_msg;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
/config_data
|
||||
/kheaders.md5
|
||||
/kheaders-objlist
|
||||
/kheaders-srclist
|
||||
|
||||
+42
-5
@@ -159,11 +159,48 @@ filechk_cat = cat $<
|
||||
$(obj)/config_data: $(KCONFIG_CONFIG) FORCE
|
||||
$(call filechk,cat)
|
||||
|
||||
# kheaders_data.tar.xz
|
||||
$(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz
|
||||
|
||||
quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz
|
||||
cmd_genikh = $(CONFIG_SHELL) $(srctree)/kernel/gen_kheaders.sh $@
|
||||
$(obj)/kheaders_data.tar.xz: FORCE
|
||||
$(call cmd,genikh)
|
||||
quiet_cmd_kheaders_data = GEN $@
|
||||
cmd_kheaders_data = "$<" "$@" "$(obj)/kheaders-srclist" "$(obj)/kheaders-objlist" "$(KBUILD_BUILD_TIMESTAMP)"
|
||||
cmd_kheaders_data_dep = cat $(depfile) >> $(dot-target).cmd; rm -f $(depfile)
|
||||
|
||||
clean-files := kheaders_data.tar.xz kheaders.md5
|
||||
define rule_kheaders_data
|
||||
$(call cmd_and_savecmd,kheaders_data)
|
||||
$(call cmd,kheaders_data_dep)
|
||||
endef
|
||||
|
||||
targets += kheaders_data.tar.xz
|
||||
$(obj)/kheaders_data.tar.xz: $(src)/gen_kheaders.sh $(obj)/kheaders-srclist $(obj)/kheaders-objlist $(obj)/kheaders.md5 FORCE
|
||||
$(call if_changed_rule,kheaders_data)
|
||||
|
||||
# generated headers in objtree
|
||||
#
|
||||
# include/generated/utsversion.h is ignored because it is generated
|
||||
# after gen_kheaders.sh is executed. (utsversion.h is unneeded for kheaders)
|
||||
filechk_kheaders_objlist = \
|
||||
for d in include "arch/$(SRCARCH)/include"; do \
|
||||
find "$${d}/generated" ! -path "include/generated/utsversion.h" -a -name "*.h" -print; \
|
||||
done
|
||||
|
||||
$(obj)/kheaders-objlist: FORCE
|
||||
$(call filechk,kheaders_objlist)
|
||||
|
||||
# non-generated headers in srctree
|
||||
filechk_kheaders_srclist = \
|
||||
for d in include "arch/$(SRCARCH)/include"; do \
|
||||
find "$(srctree)/$${d}" -path "$(srctree)/$${d}/generated" -prune -o -name "*.h" -print; \
|
||||
done
|
||||
|
||||
$(obj)/kheaders-srclist: FORCE
|
||||
$(call filechk,kheaders_srclist)
|
||||
|
||||
# Some files are symlinks. If symlinks are changed, kheaders_data.tar.xz should
|
||||
# be rebuilt.
|
||||
filechk_kheaders_md5sum = xargs -r -a $< stat -c %N | md5sum
|
||||
|
||||
$(obj)/kheaders.md5: $(obj)/kheaders-srclist FORCE
|
||||
$(call filechk,kheaders_md5sum)
|
||||
|
||||
clean-files := kheaders.md5 kheaders-srclist kheaders-objlist
|
||||
|
||||
+22
-71
@@ -4,79 +4,34 @@
|
||||
# This script generates an archive consisting of kernel headers
|
||||
# for CONFIG_IKHEADERS.
|
||||
set -e
|
||||
sfile="$(readlink -f "$0")"
|
||||
outdir="$(pwd)"
|
||||
tarfile=$1
|
||||
tmpdir=$outdir/${tarfile%/*}/.tmp_dir
|
||||
srclist=$2
|
||||
objlist=$3
|
||||
timestamp=$4
|
||||
|
||||
dir_list="
|
||||
include/
|
||||
arch/$SRCARCH/include/
|
||||
"
|
||||
dir=$(dirname "${tarfile}")
|
||||
tmpdir=${dir}/.tmp_dir
|
||||
depfile=${dir}/.$(basename "${tarfile}").d
|
||||
|
||||
# Support incremental builds by skipping archive generation
|
||||
# if timestamps of files being archived are not changed.
|
||||
# generate dependency list.
|
||||
{
|
||||
echo
|
||||
echo "deps_${tarfile} := \\"
|
||||
sed 's:\(.*\): \1 \\:' "${srclist}"
|
||||
sed -n '/^include\/generated\/autoconf\.h$/!s:\(.*\): \1 \\:p' "${objlist}"
|
||||
echo
|
||||
echo "${tarfile}: \$(deps_${tarfile})"
|
||||
echo
|
||||
echo "\$(deps_${tarfile}):"
|
||||
|
||||
# This block is useful for debugging the incremental builds.
|
||||
# Uncomment it for debugging.
|
||||
# if [ ! -f /tmp/iter ]; then iter=1; echo 1 > /tmp/iter;
|
||||
# else iter=$(($(cat /tmp/iter) + 1)); echo $iter > /tmp/iter; fi
|
||||
# find $all_dirs -name "*.h" | xargs ls -l > /tmp/ls-$iter
|
||||
|
||||
all_dirs=
|
||||
if [ "$building_out_of_srctree" ]; then
|
||||
for d in $dir_list; do
|
||||
all_dirs="$all_dirs $srctree/$d"
|
||||
done
|
||||
fi
|
||||
all_dirs="$all_dirs $dir_list"
|
||||
|
||||
# include/generated/utsversion.h is ignored because it is generated after this
|
||||
# script is executed. (utsversion.h is unneeded for kheaders)
|
||||
#
|
||||
# When Kconfig regenerates include/generated/autoconf.h, its timestamp is
|
||||
# updated, but the contents might be still the same. When any CONFIG option is
|
||||
# changed, Kconfig touches the corresponding timestamp file include/config/*.
|
||||
# Hence, the md5sum detects the configuration change anyway. We do not need to
|
||||
# check include/generated/autoconf.h explicitly.
|
||||
#
|
||||
# Ignore them for md5 calculation to avoid pointless regeneration.
|
||||
headers_md5="$(find $all_dirs -name "*.h" -a \
|
||||
! -path include/generated/utsversion.h -a \
|
||||
! -path include/generated/autoconf.h |
|
||||
xargs ls -l | md5sum | cut -d ' ' -f1)"
|
||||
|
||||
# Any changes to this script will also cause a rebuild of the archive.
|
||||
this_file_md5="$(ls -l $sfile | md5sum | cut -d ' ' -f1)"
|
||||
if [ -f $tarfile ]; then tarfile_md5="$(md5sum $tarfile | cut -d ' ' -f1)"; fi
|
||||
if [ -f kernel/kheaders.md5 ] &&
|
||||
[ "$(head -n 1 kernel/kheaders.md5)" = "$headers_md5" ] &&
|
||||
[ "$(head -n 2 kernel/kheaders.md5 | tail -n 1)" = "$this_file_md5" ] &&
|
||||
[ "$(tail -n 1 kernel/kheaders.md5)" = "$tarfile_md5" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
echo " GEN $tarfile"
|
||||
} > "${depfile}"
|
||||
|
||||
rm -rf "${tmpdir}"
|
||||
mkdir "${tmpdir}"
|
||||
|
||||
if [ "$building_out_of_srctree" ]; then
|
||||
(
|
||||
cd $srctree
|
||||
for f in $dir_list
|
||||
do find "$f" -name "*.h";
|
||||
done | tar -c -f - -T - | tar -xf - -C "${tmpdir}"
|
||||
)
|
||||
fi
|
||||
|
||||
for f in $dir_list;
|
||||
do find "$f" -name "*.h";
|
||||
done | tar -c -f - -T - | tar -xf - -C "${tmpdir}"
|
||||
|
||||
# Always exclude include/generated/utsversion.h
|
||||
# Otherwise, the contents of the tarball may vary depending on the build steps.
|
||||
rm -f "${tmpdir}/include/generated/utsversion.h"
|
||||
# shellcheck disable=SC2154 # srctree is passed as an env variable
|
||||
sed "s:^${srctree}/::" "${srclist}" | ${TAR} -c -f - -C "${srctree}" -T - | ${TAR} -xf - -C "${tmpdir}"
|
||||
${TAR} -c -f - -T "${objlist}" | ${TAR} -xf - -C "${tmpdir}"
|
||||
|
||||
# Remove comments except SDPX lines
|
||||
# Use a temporary file to store directory contents to prevent find/xargs from
|
||||
@@ -88,12 +43,8 @@ xargs -0 -P8 -n1 \
|
||||
rm -f "${tmpdir}.contents.txt"
|
||||
|
||||
# Create archive and try to normalize metadata for reproducibility.
|
||||
tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
|
||||
${TAR} "${timestamp:+--mtime=$timestamp}" \
|
||||
--owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \
|
||||
-I $XZ -cf $tarfile -C "${tmpdir}/" . > /dev/null
|
||||
|
||||
echo $headers_md5 > kernel/kheaders.md5
|
||||
echo "$this_file_md5" >> kernel/kheaders.md5
|
||||
echo "$(md5sum $tarfile | cut -d ' ' -f1)" >> kernel/kheaders.md5
|
||||
-I "${XZ}" -cf "${tarfile}" -C "${tmpdir}/" . > /dev/null
|
||||
|
||||
rm -rf "${tmpdir}"
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
|
||||
check_vmlinux()
|
||||
{
|
||||
# Use readelf to check if it's a valid ELF
|
||||
# TODO: find a better to way to check that it's really vmlinux
|
||||
# and not just an elf
|
||||
readelf -h $1 > /dev/null 2>&1 || return 1
|
||||
|
||||
cat $1
|
||||
exit 0
|
||||
if file "$1" | grep -q 'Linux kernel.*boot executable' ||
|
||||
readelf -h "$1" > /dev/null 2>&1
|
||||
then
|
||||
cat "$1"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
try_decompress()
|
||||
|
||||
@@ -15,7 +15,7 @@ void cache_set(struct cache *cache, unsigned long key, int value)
|
||||
{
|
||||
struct cache_item *ci;
|
||||
|
||||
ci = xmalloc(sizeof(struct cache_item));
|
||||
ci = xmalloc(sizeof(*ci));
|
||||
ci->key = key;
|
||||
ci->value = value;
|
||||
hash_add(cache->cache, &ci->hash, hash_32(key));
|
||||
|
||||
@@ -33,7 +33,7 @@ static struct die *create_die(Dwarf_Die *die, enum die_state state)
|
||||
{
|
||||
struct die *cd;
|
||||
|
||||
cd = xmalloc(sizeof(struct die));
|
||||
cd = xmalloc(sizeof(*cd));
|
||||
init_die(cd);
|
||||
cd->addr = (uintptr_t)die->addr;
|
||||
|
||||
@@ -123,7 +123,7 @@ static struct die_fragment *append_item(struct die *cd)
|
||||
{
|
||||
struct die_fragment *df;
|
||||
|
||||
df = xmalloc(sizeof(struct die_fragment));
|
||||
df = xmalloc(sizeof(*df));
|
||||
df->type = FRAGMENT_EMPTY;
|
||||
list_add_tail(&df->list, &cd->fragments);
|
||||
return df;
|
||||
|
||||
@@ -634,7 +634,7 @@ static int get_union_kabi_status(Dwarf_Die *die, Dwarf_Die *placeholder,
|
||||
* Note that the user of this feature is responsible for ensuring
|
||||
* that the structure actually remains ABI compatible.
|
||||
*/
|
||||
memset(&state.kabi, 0, sizeof(struct kabi_state));
|
||||
memset(&state.kabi, 0, sizeof(state.kabi));
|
||||
|
||||
res = checkp(process_die_container(&state, NULL, die,
|
||||
check_union_member_kabi_status,
|
||||
|
||||
@@ -228,7 +228,7 @@ void kabi_read_rules(int fd)
|
||||
if (type == KABI_RULE_TYPE_UNKNOWN)
|
||||
error("unsupported kABI rule type: '%s'", field);
|
||||
|
||||
rule = xmalloc(sizeof(struct rule));
|
||||
rule = xmalloc(sizeof(*rule));
|
||||
|
||||
rule->type = type;
|
||||
rule->target = xstrdup(get_rule_field(&rule_str, &left));
|
||||
|
||||
@@ -146,7 +146,7 @@ void symbol_read_exports(FILE *file)
|
||||
continue;
|
||||
}
|
||||
|
||||
sym = xcalloc(1, sizeof(struct symbol));
|
||||
sym = xcalloc(1, sizeof(*sym));
|
||||
sym->name = name;
|
||||
sym->addr.section = SHN_UNDEF;
|
||||
sym->state = SYMBOL_UNPROCESSED;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#include "gendwarfksyms.h"
|
||||
@@ -43,7 +45,7 @@ static int type_list_append(struct list_head *list, const char *s, void *owned)
|
||||
if (!s)
|
||||
return 0;
|
||||
|
||||
entry = xmalloc(sizeof(struct type_list_entry));
|
||||
entry = xmalloc(sizeof(*entry));
|
||||
entry->str = s;
|
||||
entry->owned = owned;
|
||||
list_add_tail(&entry->list, list);
|
||||
@@ -120,7 +122,7 @@ static struct type_expansion *type_map_add(const char *name,
|
||||
struct type_expansion *e;
|
||||
|
||||
if (__type_map_get(name, &e)) {
|
||||
e = xmalloc(sizeof(struct type_expansion));
|
||||
e = xmalloc(sizeof(*e));
|
||||
type_expansion_init(e);
|
||||
e->name = xstrdup(name);
|
||||
|
||||
@@ -179,20 +181,41 @@ static int type_map_get(const char *name, struct type_expansion **res)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int cmp_expansion_name(const void *p1, const void *p2)
|
||||
{
|
||||
struct type_expansion *const *e1 = p1;
|
||||
struct type_expansion *const *e2 = p2;
|
||||
|
||||
return strcmp((*e1)->name, (*e2)->name);
|
||||
}
|
||||
|
||||
static void type_map_write(FILE *file)
|
||||
{
|
||||
struct type_expansion *e;
|
||||
struct hlist_node *tmp;
|
||||
struct type_expansion **es;
|
||||
size_t count = 0;
|
||||
size_t i = 0;
|
||||
|
||||
if (!file)
|
||||
return;
|
||||
|
||||
hash_for_each_safe(type_map, e, tmp, hash) {
|
||||
checkp(fputs(e->name, file));
|
||||
hash_for_each_safe(type_map, e, tmp, hash)
|
||||
++count;
|
||||
es = xmalloc(count * sizeof(*es));
|
||||
hash_for_each_safe(type_map, e, tmp, hash)
|
||||
es[i++] = e;
|
||||
|
||||
qsort(es, count, sizeof(*es), cmp_expansion_name);
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
checkp(fputs(es[i]->name, file));
|
||||
checkp(fputs(" ", file));
|
||||
type_list_write(&e->expanded, file);
|
||||
type_list_write(&es[i]->expanded, file);
|
||||
checkp(fputs("\n", file));
|
||||
}
|
||||
|
||||
free(es);
|
||||
}
|
||||
|
||||
static void type_map_free(void)
|
||||
|
||||
@@ -594,7 +594,7 @@ static void check_conf(struct menu *menu)
|
||||
default:
|
||||
if (!conf_cnt++)
|
||||
printf("*\n* Restart config...\n*\n");
|
||||
rootEntry = menu_get_parent_menu(menu);
|
||||
rootEntry = menu_get_menu_or_parent_menu(menu);
|
||||
conf(rootEntry);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ static bool is_same(const char *file1, const char *file2)
|
||||
if (map2 == MAP_FAILED)
|
||||
goto close2;
|
||||
|
||||
if (bcmp(map1, map2, st1.st_size))
|
||||
if (memcmp(map1, map2, st1.st_size))
|
||||
goto close2;
|
||||
|
||||
ret = true;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user