Print this page
OS-3280 need a way to specify the root of a native system in the lx brand
OS-3279 lx brand should allow delegated datasets
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/pgrep/pgrep.c
          +++ new/usr/src/cmd/pgrep/pgrep.c
↓ open down ↓ 589 lines elided ↑ open up ↑
 590  590  }
 591  591  
 592  592  int
 593  593  main(int argc, char *argv[])
 594  594  {
 595  595          void (*funcp)(psinfo_t *);
 596  596  
 597  597          const char *optstr;
 598  598          optdesc_t *optd;
 599  599          int nmatches, c;
      600 +        const char *zroot;
      601 +        char buf[PATH_MAX];
 600  602  
 601  603          DIR *dirp;
 602  604  
 603  605          (void) setlocale(LC_ALL, "");
 604  606          (void) textdomain(TEXT_DOMAIN);
 605  607  
 606  608          UU_EXIT_FATAL = E_ERROR;
 607  609  
 608  610          g_pname = uu_setpname(argv[0]);
 609  611          g_pid = getpid();
↓ open down ↓ 9 lines elided ↑ open up ↑
 619  621                          argc--;
 620  622                  }
 621  623  
 622  624                  optstr = PKILL_OPTS;
 623  625                  g_flags |= F_KILL;
 624  626          } else
 625  627                  optstr = PGREP_OPTS;
 626  628  
 627  629          opterr = 0;
 628  630  
      631 +        zroot = zone_get_nroot();
      632 +        if (zroot != NULL) {
      633 +                (void) snprintf(buf, sizeof (buf), "%s/%s", zroot, g_procdir);
      634 +                g_procdir = buf;
      635 +        }
      636 +
 629  637          while (optind < argc) {
 630  638                  while ((c = getopt(argc, argv, optstr)) != (int)EOF) {
 631  639  
 632  640                          if (c == ':' || c == '?' ||
 633  641                              g_optdtab[c - 'A'].o_opts == 0) {
 634  642                                  if (c == ':') {
 635  643                                          uu_warn(
 636  644                                              gettext("missing argument -- %c\n"),
 637  645                                              optopt);
 638  646                                  } else if (optopt != '?') {
↓ open down ↓ 77 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX