Print this page
patch tsoome-feedback

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libipp/libipp.c
          +++ new/usr/src/lib/libipp/libipp.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2001-2002 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  #include <stdio.h>
  30   28  #include <stdlib.h>
  31   29  #include <sys/types.h>
  32   30  #include <sys/stat.h>
  33   31  #include <unistd.h>
  34   32  #include <errno.h>
  35   33  #include <strings.h>
  36   34  #include <string.h>
  37   35  #include <fcntl.h>
  38   36  #include <assert.h>
↓ open down ↓ 179 lines elided ↑ open up ↑
 218  216                  DBG1(DBG_ERR, "failed to add '%s' to nvlist\n", IPPCTL_FLAGS);
 219  217                  goto failed;
 220  218          }
 221  219  
 222  220          /*
 223  221           * Talk to the kernel.
 224  222           */
 225  223  
 226  224          return (dispatch(&nvlp, NULL, NULL));
 227  225  failed:
 228      -        if (nvlp != NULL)
 229      -                nvlist_free(nvlp);
      226 +        nvlist_free(nvlp);
 230  227          errno = rc;
 231  228          return (-1);
 232  229  }
 233  230  #undef  __FN__
 234  231  
 235  232  #define __FN__  "ipp_action_modify"
 236  233  int
 237  234  ipp_action_modify(
 238  235          const char      *aname,
 239  236          nvlist_t        **nvlpp,
↓ open down ↓ 89 lines elided ↑ open up ↑
 329  326                  DBG1(DBG_ERR, "failed to add '%s' to nvlist\n", IPPCTL_FLAGS);
 330  327                  goto failed;
 331  328          }
 332  329  
 333  330          /*
 334  331           * Talk to the kernel.
 335  332           */
 336  333  
 337  334          return (dispatch(&nvlp, fn, arg));
 338  335  failed:
 339      -        if (nvlp != NULL)
 340      -                nvlist_free(nvlp);
      336 +        nvlist_free(nvlp);
 341  337          errno = rc;
 342  338          return (-1);
 343  339  }
 344  340  #undef  __FN__
 345  341  
 346  342  #define __FN__  "ipp_action_mod"
 347  343  int
 348  344  ipp_action_mod(
 349  345          const char      *aname,
 350  346          char            **modnamep)
↓ open down ↓ 31 lines elided ↑ open up ↑
 382  378                  DBG1(DBG_ERR, "failed to add '%s' to nvlist\n", IPPCTL_ANAME);
 383  379                  goto failed;
 384  380          }
 385  381  
 386  382          /*
 387  383           * Talk to the kernel.
 388  384           */
 389  385  
 390  386          return (dispatch(&nvlp, string_callback, (void *)modnamep));
 391  387  failed:
 392      -        if (nvlp != NULL)
 393      -                nvlist_free(nvlp);
      388 +        nvlist_free(nvlp);
 394  389          errno = rc;
 395  390          return (-1);
 396  391  }
 397  392  #undef  __FN__
 398  393  
 399  394  #define __FN__  "ipp_list_mods"
 400  395  int
 401  396  ipp_list_mods(
 402  397          char            ***modname_arrayp,
 403  398          int             *neltp)
↓ open down ↓ 35 lines elided ↑ open up ↑
 439  434          ad.array = NULL;
 440  435          ad.nelt = 0;
 441  436  
 442  437          if ((rc = dispatch(&nvlp, string_array_callback, (void *)&ad)) == 0) {
 443  438                  *modname_arrayp = ad.array;
 444  439                  *neltp = ad.nelt;
 445  440          }
 446  441  
 447  442          return (rc);
 448  443  failed:
 449      -        if (nvlp != NULL)
 450      -                nvlist_free(nvlp);
      444 +        nvlist_free(nvlp);
 451  445          errno = rc;
 452  446          return (-1);
 453  447  }
 454  448  #undef  __FN__
 455  449  
 456  450  #define __FN__  "ipp_mod_list_actions"
 457  451  int
 458  452  ipp_mod_list_actions(
 459  453          const char      *modname,
 460  454          char            ***aname_arrayp,
↓ open down ↓ 42 lines elided ↑ open up ↑
 503  497          ad.array = NULL;
 504  498          ad.nelt = 0;
 505  499  
 506  500          if ((rc = dispatch(&nvlp, string_array_callback, (void *)&ad)) == 0) {
 507  501                  *aname_arrayp = ad.array;
 508  502                  *neltp = ad.nelt;
 509  503          }
 510  504  
 511  505          return (rc);
 512  506  failed:
 513      -        if (nvlp != NULL)
 514      -                nvlist_free(nvlp);
      507 +        nvlist_free(nvlp);
 515  508          errno = rc;
 516  509          return (-1);
 517  510  }
 518  511  #undef  __FN__
 519  512  
 520  513  #define __FN__  "ipp_free"
 521  514  void
 522  515  ipp_free(
 523  516          char    *buf)
 524  517  {
↓ open down ↓ 393 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX