Print this page
3946 ::gcore
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libproc/common/Pgcore.c
          +++ new/usr/src/lib/libproc/common/Pgcore.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  /*
  27   27   * Copyright 2012 DEY Storage Systems, Inc.  All rights reserved.
  28   28   * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       29 + * Copyright (c) 2013 by Delphix. All rights reserved.
  29   30   */
  30   31  
  31   32  #define _STRUCTURED_PROC        1
  32   33  
  33   34  #include <stdlib.h>
  34   35  #include <ctype.h>
  35   36  #include <string.h>
  36   37  #include <strings.h>
  37   38  #include <errno.h>
  38   39  #include <procfs.h>
↓ open down ↓ 1311 lines elided ↑ open up ↑
1350 1351                  if (Pcred(P, cp, cred.pr_ngroups) != 0 ||
1351 1352                      write_note(fd, NT_PRCRED, cp, size, &doff) != 0) {
1352 1353                          free(cp);
1353 1354                          goto err;
1354 1355                  }
1355 1356  
1356 1357                  free(cp);
1357 1358          }
1358 1359  
1359 1360          {
1360      -                prpriv_t *ppriv;
     1361 +                prpriv_t *ppriv = NULL;
1361 1362                  const priv_impl_info_t *pinfo;
1362 1363                  size_t pprivsz, pinfosz;
1363 1364  
1364      -                if ((ppriv = proc_get_priv(P->pid)) == NULL)
     1365 +                if (Ppriv(P, &ppriv) == -1)
1365 1366                          goto err;
1366 1367                  pprivsz = PRIV_PRPRIV_SIZE(ppriv);
1367 1368  
1368 1369                  if (write_note(fd, NT_PRPRIV, ppriv, pprivsz, &doff) != 0) {
1369 1370                          free(ppriv);
1370 1371                          goto err;
1371 1372                  }
1372 1373                  free(ppriv);
1373 1374  
1374 1375                  if ((pinfo = getprivimplinfo()) == NULL)
↓ open down ↓ 255 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX