Print this page
8485 Remove set but unused variables in usr/src/cmd

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ldap/common/fileurl.c
          +++ new/usr/src/cmd/ldap/common/fileurl.c
   1    1  /*
        2 + * Copyright 2017 Gary Mills
   2    3   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
   3    4   * Use is subject to license terms.
   4    5   */
   5    6  
   6    7  /* 
   7    8   * The contents of this file are subject to the Netscape Public
   8    9   * License Version 1.1 (the "License"); you may not use this file
   9   10   * except in compliance with the License. You may obtain a copy of
  10   11   * the License at http://www.mozilla.org/NPL/
  11   12   *  
↓ open down ↓ 341 lines elided ↑ open up ↑
 353  354   * If successful, LDAPTOOL_FILEURL_SUCCESS is returned and bvp->bv_len
 354  355   * and bvp->bv_val are set (the latter is set to malloc'd memory).
 355  356   * Upon failure, a different LDAPTOOL_FILEURL_ error code is returned.
 356  357   */
 357  358  
 358  359  static int
 359  360  berval_from_file( const char *path, struct berval *bvp, int reporterrs )
 360  361  {
 361  362      FILE        *fp;
 362  363      long        rlen;
 363      -    int         eof;
 364  364  #if defined( XP_WIN32 )
 365  365      char        mode[20] = "r+b";
 366  366  #else
 367  367      char        mode[20] = "r";
 368  368  #endif
 369  369  
 370  370  #ifdef SOLARIS_LDAP_CMD
 371  371      if (( fp = fopen( path, mode )) == NULL ) {
 372  372  #else
 373  373      if (( fp = ldaptool_open_file( path, mode )) == NULL ) {
↓ open down ↓ 16 lines elided ↑ open up ↑
 390  390          return( LDAPTOOL_FILEURL_NOMEMORY );
 391  391      }
 392  392  
 393  393      if ( fseek( fp, 0L, SEEK_SET ) != 0 ) {
 394  394          if ( reporterrs ) perror( path );
 395  395          fclose( fp );
 396  396          return( LDAPTOOL_FILEURL_FILEIOERROR );
 397  397      }
 398  398  
 399  399      rlen = fread( bvp->bv_val, 1, bvp->bv_len, fp );
 400      -    eof = feof( fp );
 401  400      fclose( fp );
 402  401  
 403  402      if ( rlen != (long)bvp->bv_len ) {
 404  403          if ( reporterrs ) perror( path );
 405  404          free( bvp->bv_val );
 406  405          return( LDAPTOOL_FILEURL_FILEIOERROR );
 407  406      }
 408  407  
 409  408      bvp->bv_val[ bvp->bv_len ] = '\0';
 410  409      return( LDAPTOOL_FILEURL_SUCCESS );
↓ open down ↓ 107 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX