dso.c (78a1f7cd9000d5d633268a2acb2d9b62d41a2f2c) dso.c (7031edac9dbc0f880c9fbaa40ca08b5de34239c6)
1// SPDX-License-Identifier: GPL-2.0
2#include <asm/bug.h>
3#include <linux/kernel.h>
4#include <linux/string.h>
5#include <linux/zalloc.h>
6#include <sys/time.h>
7#include <sys/resource.h>
8#include <sys/types.h>

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

486 break;
487
488 close_first_dso();
489 } while (1);
490
491 return -1;
492}
493
1// SPDX-License-Identifier: GPL-2.0
2#include <asm/bug.h>
3#include <linux/kernel.h>
4#include <linux/string.h>
5#include <linux/zalloc.h>
6#include <sys/time.h>
7#include <sys/resource.h>
8#include <sys/types.h>

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

486 break;
487
488 close_first_dso();
489 } while (1);
490
491 return -1;
492}
493
494char *dso__filename_with_chroot(const struct dso *dso, const char *filename)
495{
496 return filename_with_chroot(nsinfo__pid(dso->nsinfo), filename);
497}
498
494static int __open_dso(struct dso *dso, struct machine *machine)
495{
496 int fd = -EINVAL;
497 char *root_dir = (char *)"";
498 char *name = malloc(PATH_MAX);
499 bool decomp = false;
500
501 if (!name)

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

510 goto out;
511
512 if (!is_regular_file(name)) {
513 char *new_name;
514
515 if (errno != ENOENT || dso->nsinfo == NULL)
516 goto out;
517
499static int __open_dso(struct dso *dso, struct machine *machine)
500{
501 int fd = -EINVAL;
502 char *root_dir = (char *)"";
503 char *name = malloc(PATH_MAX);
504 bool decomp = false;
505
506 if (!name)

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

515 goto out;
516
517 if (!is_regular_file(name)) {
518 char *new_name;
519
520 if (errno != ENOENT || dso->nsinfo == NULL)
521 goto out;
522
518 new_name = filename_with_chroot(dso->nsinfo->pid, name);
523 new_name = dso__filename_with_chroot(dso, name);
519 if (!new_name)
520 goto out;
521
522 free(name);
523 name = new_name;
524 }
525
526 if (dso__needs_decompress(dso)) {

--- 961 unchanged lines hidden ---
524 if (!new_name)
525 goto out;
526
527 free(name);
528 name = new_name;
529 }
530
531 if (dso__needs_decompress(dso)) {

--- 961 unchanged lines hidden ---