Project

General

Profile

Bug #2655 ยป lint12.3.patch

suggested fix - Milan Jurik, 2012-04-30 04:50 PM

View differences:

new/usr/src/cmd/auditreduce/option.c Mon Apr 30 18:39:15 2012
342 342
			return (-1);
343 343
		}
344 344
		return (0);
345
		/* NOTREACHED */
346 345
	case OBJ_SOCK:
347 346
		if (!a_isnum(obj_val, TRUE)) {
348 347
			obj_id = atol(obj_val);
......
389 388
		freehostent(he);
390 389
		socket_flag = SOCKFLG_MACHINE;
391 390
		return (0);
392
		break;
393 391
	case OBJ_MSG:
394 392
	case OBJ_SEM:
395 393
	case OBJ_SHM:
396 394
	case OBJ_PROC:
397 395
		obj_id = atol(obj_val);
398 396
		return (0);
399
		/* NOTREACHED */
400 397
	case OBJ_FGROUP:
401 398
	case OBJ_MSGGROUP:
402 399
	case OBJ_SEMGROUP:
403 400
	case OBJ_SHMGROUP:
404 401
	case OBJ_PGROUP:
405 402
		return (proc_group(obj_val, &obj_group));
406
		/* NOTREACHED */
407 403
	case OBJ_FOWNER:
408 404
	case OBJ_MSGOWNER:
409 405
	case OBJ_SEMOWNER:
410 406
	case OBJ_SHMOWNER:
411 407
	case OBJ_POWNER:
412 408
		return (proc_user(obj_val, &obj_owner));
413
		/* NOTREACHED */
414 409
	case OBJ_FMRI:
415 410
		return (proc_fmri(obj_val));
416
		/* NOTREACHED */
417 411
	case OBJ_USER:
418 412
		return (proc_user(obj_val, &obj_user));
419
		/* NOTREACHED */
420 413
	case OBJ_LP: /* lp objects have not yet been defined */
421 414
	default: /* impossible */
422 415
		(void) sprintf(errbuf, gettext("invalid object type (%s)"),
423 416
		    obj_str);
424 417
		error_str = errbuf;
425 418
		return (-1);
426
		/* NOTREACHED */
427 419
	} /* switch */
428 420
	/*NOTREACHED*/
429 421
}
......
538 530
		}
539 531
		flags |= M_USERE;
540 532
		return (proc_user(optstr, &m_usere));
541
		/* NOTREACHED */
542 533
	case 'f': 		/* effective group id */
543 534
		if (flags & M_GROUPE) {
544 535
			error_str = gettext(
......
547 538
		}
548 539
		flags |= M_GROUPE;
549 540
		return (proc_group(optstr, &m_groupe));
550
		/* NOTREACHED */
551 541
	case 'r': 		/* real user id */
552 542
		if (flags & M_USERR) {
553 543
			error_str = gettext(
......
556 546
		}
557 547
		flags |= M_USERR;
558 548
		return (proc_user(optstr, &m_userr));
559
		/* NOTREACHED */
560 549
	case 'u': 		/* audit user id */
561 550
		if (flags & M_USERA) {
562 551
			error_str = gettext(
......
565 554
		}
566 555
		flags |= M_USERA;
567 556
		return (proc_user(optstr, &m_usera));
568
		/* NOTREACHED */
569 557
	case 'g': 		/* real group id */
570 558
		if (flags & M_GROUPR) {
571 559
			error_str = gettext(
......
574 562
		}
575 563
		flags |= M_GROUPR;
576 564
		return (proc_group(optstr, &m_groupr));
577
		/* NOTREACHED */
578 565
	default: 		/* impossible */
579 566
		(void) sprintf(errbuf, gettext("'%c' unknown option"), opt);
580 567
		error_str = errbuf;
581 568
		return (-1);
582
		/* NOTREACHED */
583 569
	}
584 570
	/*NOTREACHED*/
585 571
}
586
-- old/usr/src/cmd/cmd-inet/usr.bin/rcp.c	Mon Apr 30 18:39:17 2012
572
++ new/usr/src/cmd/cmd-inet/usr.bin/rcp.c	Mon Apr 30 18:39:16 2012
......
1508 1508
				error("%s\n", cp);
1509 1509
				exit(1);
1510 1510
			}
1511
			/* This cannot be reached. */
1512
			/* LINTED E_STMT_NOT_REACHED */
1511 1513
			SCREWUP("expected control record");
1512 1514
		}
1513 1515
		mode = 0;
1514
-- old/usr/src/cmd/genmsg/genmsg.l	Mon Apr 30 18:39:18 2012
1516
++ new/usr/src/cmd/genmsg/genmsg.l	Mon Apr 30 18:39:17 2012
......
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 <limits.h>
......
322 320

  
323 321
-((([ \t]+)1)|1) {	/* -1 */
324 322
			if (end_of_cat == FALSE) {
325
				REJECT;
323
				REJECT
326 324
			} else if (IsActiveMode(ReplaceMode)) {
327 325
				if (IsActiveMode(PreProcessMode)) {
328 326
					int id = get_linemsgid(lineno);
329
-- old/usr/src/cmd/mpathadm/mpathadm.c	Mon Apr 30 18:39:18 2012
327
++ new/usr/src/cmd/mpathadm/mpathadm.c	Mon Apr 30 18:39:18 2012
......
3144 3144

  
3145 3145
	for (i = 0; i < numChars; i++) {
3146 3146
		if (L'\0' != arrayToDisplay[i]) {
3147
			(void) fprintf(stdout, "%wc", arrayToDisplay[i]);
3147
			(void) fprintf(stdout, "%wc", (int)arrayToDisplay[i]);
3148 3148
		}
3149 3149
	}
3150 3150
}
3151
-- old/usr/src/lib/fm/topo/modules/common/ses/ses.c	Mon Apr 30 18:39:19 2012
3151
++ new/usr/src/lib/fm/topo/modules/common/ses/ses.c	Mon Apr 30 18:39:19 2012
......
545 545
			/* if this is the negend, then abandon the contract */
546 546
			ses_ct_print("got contract negend");
547 547
			if (stp->set_ctid) {
548
				snprintf(buf, sizeof (buf),
548
				(void) snprintf(buf, sizeof (buf),
549 549
				    "abandon old contract %d", stp->set_ctid);
550 550
				ses_ct_print(buf);
551 551
				stp->set_ctid = NULL;
552 552
			}
553 553
			(void) ct_ctl_abandon(ctlfd);
554 554
		}
555
		close(ctlfd);
555
		(void) close(ctlfd);
556 556
		(void) pthread_mutex_unlock(&stp->set_lock);
557 557
		ct_event_free(ev);
558 558
		(void) pthread_mutex_unlock(&ses_sslmt);
559 559
	}
560
	close(efd);
560
	(void) close(efd);
561 561
	return (NULL);
562 562
}
563 563

  
......
692 692
		topo_mod_dprintf(mod, "failed to create ctid rval = %d", rval);
693 693
	else
694 694
		topo_mod_dprintf(mod, "created ctid=%d", stp->set_ctid);
695
	close(tfd);
695
	(void) close(tfd);
696 696
}
697 697

  
698 698
static void
......
715 715
			(void) snprintf(path, PATH_MAX,
716 716
			    CTFS_ROOT "/device/%ld/ctl", stp->set_ctid);
717 717
			ctlfd = open64(path, O_WRONLY);
718
			ct_ctl_abandon(ctlfd);
719
			close(ctlfd);
718
			(void) ct_ctl_abandon(ctlfd);
719
			(void) close(ctlfd);
720 720
			stp->set_ctid = NULL;
721 721
		}
722 722
		(void) pthread_mutex_unlock(&stp->set_lock);
723
-- old/usr/src/lib/libc/port/gen/privlib.c	Mon Apr 30 18:39:20 2012
723
++ new/usr/src/lib/libc/port/gen/privlib.c	Mon Apr 30 18:39:20 2012
......
757 757
int
758 758
priv_getbyname(const char *name)
759 759
{
760
	WITHPRIVLOCKED(int, -1, __priv_getbyname(GETPRIVDATA(), name));
760
	WITHPRIVLOCKED(int, -1, __priv_getbyname(GETPRIVDATA(), name))
761 761
}
762 762

  
763 763
int
......
806 806
const char *
807 807
priv_getbynum(int num)
808 808
{
809
	WITHPRIVLOCKED(const char *, NULL, __priv_getbynum(GETPRIVDATA(), num));
809
	WITHPRIVLOCKED(const char *, NULL, __priv_getbynum(GETPRIVDATA(), num))
810 810
}
811 811

  
812 812
const char *
813
-- old/usr/src/lib/libidmap/common/idmap_api.c	Mon Apr 30 18:39:21 2012
813
++ new/usr/src/lib/libidmap/common/idmap_api.c	Mon Apr 30 18:39:21 2012
......
20 20
 */
21 21
/*
22 22
 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23
 * Copyright Milan Jurik 2012. All rights reserved.
23 24
 */
24 25

  
25 26

  
......
65 66
	itera->limit = 1024;\
66 67
	itera->arg = argu;
67 68

  
68

  
69
#define	__ITER_ERR_RETURN(itera, argu, xdr_argu, iretcod)\
70
	if (argu) {\
71
		xdr_free(xdr_argu, (caddr_t)argu);\
72
		free(argu);\
73
	}\
74
	if (itera)\
75
		free(itera);\
76
	return (iretcod);
77

  
78

  
79 69
#define	__ITER_CHECK(itera, ityp)\
80 70
	if (itera == NULL) {\
81 71
		errno = EINVAL;\
......
606 596
	return (IDMAP_SUCCESS);
607 597

  
608 598
errout:
609
	__ITER_ERR_RETURN(tmpiter, arg,
610
	    xdr_idmap_list_namerules_1_argument, retcode);
599
	if (arg) {
600
		xdr_free(xdr_idmap_list_namerules_1_argument, (char *)arg);
601
		free(arg);
602
	}
603
	if (tmpiter)
604
		free(tmpiter);
605

  
606
	return (retcode);
611 607
}
612 608

  
613 609

  
    (1-1/1)