[DTrace-devel] [PATCH 4/6] modules: fix can-never-fail comparison

Eugene Loh eugene.loh at oracle.com
Fri Mar 4 20:58:13 UTC 2022


Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Copyright year on file?
Also, do you really mean to retain the ! in the updated line?

On 3/2/22 8:44 AM, Nick Alcock via DTrace-devel wrote:
> Spotted by GCC 11.
>
> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
> ---
>   libdtrace/dt_module.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libdtrace/dt_module.c b/libdtrace/dt_module.c
> index 656b39d18d57..990fb40ad7f2 100644
> --- a/libdtrace/dt_module.c
> +++ b/libdtrace/dt_module.c
> @@ -195,7 +195,7 @@ dt_module_init_elf(dtrace_hdl_t *dtp, dt_module_t *dmp)
>   	int fd, err, bits;
>   	size_t shstrs;
>   
> -	if (!dmp->dm_file) {
> +	if (!dmp->dm_file[0] == '\0') {
>   		dt_dprintf("failed to open ELF file for module %s: "
>   		    "no file name known\n", dmp->dm_name);
>   		return dt_set_errno(dtp, EDT_NOTLOADED);



More information about the DTrace-devel mailing list