Print this page
3900 illumos will not build against gcc compiled perl
4723 Remove unused perl extensions
Reviewed by: Keith Wesolowski <keith.wesolowski@joyent.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Project.xs
          +++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Project.xs
   1    1  /*
   2    2   * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
        3 + * Copyright (c) 2014 Racktop Systems.
   3    4   */
   4    5  /*
   5    6   * Project.xs contains XS wrappers for the project database maniplulation
   6    7   * functions as provided by libproject and described in getprojent(3EXACCT).
   7    8   */
   8    9  
   9   10  /* Solaris includes. */
  10   11  #include <zone.h>
  11   12  #include <project.h>
  12   13  #include <pool.h>
↓ open down ↓ 140 lines elided ↑ open up ↑
 153  154          project_walk(&pwalk_cb, (void*)&nitems);
 154  155          XSRETURN(nitems);
 155  156  
 156  157  void
 157  158  getprojent()
 158  159  PREINIT:
 159  160          struct project  proj, *projp;
 160  161          char            buf[PROJECT_BUFSZ];
 161  162  PPCODE:
 162  163          PUTBACK;
 163      -        if (projp = getprojent(&proj, buf, sizeof (buf))) {
      164 +        if ((projp = getprojent(&proj, buf, sizeof (buf)))) {
 164  165                  XSRETURN(pushret_project(projp));
 165  166          } else {
 166  167                  XSRETURN_EMPTY;
 167  168          }
 168  169  
 169  170  void
 170  171  setprojent()
 171  172  
 172  173  void
 173  174  endprojent()
 174  175  
 175  176  void
 176  177  getprojbyname(name)
 177  178          char    *name
 178  179  PREINIT:
 179  180          struct project  proj, *projp;
 180  181          char            buf[PROJECT_BUFSZ];
 181  182  PPCODE:
 182  183          PUTBACK;
 183      -        if (projp = getprojbyname(name, &proj, buf, sizeof (buf))) {
      184 +        if ((projp = getprojbyname(name, &proj, buf, sizeof (buf)))) {
 184  185                  XSRETURN(pushret_project(projp));
 185  186          } else {
 186  187                  XSRETURN_EMPTY;
 187  188          }
 188  189  
 189  190  void
 190  191  getprojbyid(id)
 191  192          projid_t        id
 192  193  PREINIT:
 193  194          struct project  proj, *projp;
 194  195          char            buf[PROJECT_BUFSZ];
 195  196  PPCODE:
 196  197          PUTBACK;
 197      -        if (projp = getprojbyid(id, &proj, buf, sizeof (buf))) {
      198 +        if ((projp = getprojbyid(id, &proj, buf, sizeof (buf)))) {
 198  199                  XSRETURN(pushret_project(projp));
 199  200          } else {
 200  201                  XSRETURN_EMPTY;
 201  202          }
 202  203  
 203  204  void
 204  205  getdefaultproj(user)
 205  206          char    *user
 206  207  PREINIT:
 207  208          struct project  proj, *projp;
 208  209          char            buf[PROJECT_BUFSZ];
 209  210  PPCODE:
 210  211          PUTBACK;
 211      -        if (projp = getdefaultproj(user, &proj, buf, sizeof (buf))) {
      212 +        if ((projp = getdefaultproj(user, &proj, buf, sizeof (buf)))) {
 212  213                  XSRETURN(pushret_project(projp));
 213  214          } else {
 214  215                  XSRETURN_EMPTY;
 215  216          }
 216  217  
 217  218  void
 218  219  fgetprojent(fh)
 219  220          FILE    *fh
 220  221  PREINIT:
 221  222          struct project  proj, *projp;
 222  223          char            buf[PROJECT_BUFSZ];
 223  224  PPCODE:
 224  225          PUTBACK;
 225      -        if (projp = fgetprojent(fh, &proj, buf, sizeof (buf))) {
      226 +        if ((projp = fgetprojent(fh, &proj, buf, sizeof (buf)))) {
 226  227                  XSRETURN(pushret_project(projp));
 227  228          } else {
 228  229                  XSRETURN_EMPTY;
 229  230          }
 230  231  
 231  232  bool
 232  233  inproj(user, proj)
 233  234          char    *user
 234  235          char    *proj
 235  236  PREINIT:
 236  237          char    buf[PROJECT_BUFSZ];
 237  238  CODE:
 238  239          RETVAL = inproj(user, proj, buf, sizeof (buf));
      240 +OUTPUT:
      241 +        RETVAL
 239  242  
 240  243  
 241  244  int
 242  245  getprojidbyname(proj)
 243  246          char    *proj
 244  247  PREINIT:
 245  248          int     id;
 246  249  PPCODE:
 247  250          if ((id = getprojidbyname(proj)) == -1) {
 248  251                  XSRETURN_UNDEF;
↓ open down ↓ 12 lines elided ↑ open up ↑
 261  264  # This function is private to Project.pm
 262  265  void
 263  266  rctl_get_info(name)
 264  267          char    *name
 265  268  PREINIT:
 266  269          rctlblk_t *blk1 = NULL;
 267  270          rctlblk_t *blk2 = NULL;
 268  271          rctlblk_t *tmp = NULL;
 269  272          rctl_priv_t priv;
 270  273          rctl_qty_t value;
 271      -        int flags;
      274 +        int flags = 0;
 272  275          int ret;
 273  276          int err = 0;
 274  277          char string[24];        /* 24 will always hold a uint64_t */
 275  278  PPCODE:
 276  279          Newc(0, blk1, rctlblk_size(), char, rctlblk_t);
 277  280          if (blk1 == NULL) {
 278  281                  err = 1;
 279  282                  goto out;
 280  283          }
 281  284          Newc(1, blk2, rctlblk_size(), char, rctlblk_t);
↓ open down ↓ 98 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX