Sun RPC documentation error?

David Stubbs davidst at tekcrl.labs.tek.com
Sat Jun 16 02:20:18 AEST 1990


Am I missing something, or has the bus already passed this way???  This is
a sample program in Sun's "REMOTE PROCEDURE CALL PROGRAMMING GUIDE"
(Revision B of 17 February 1986), section 2.1, page 7:

     1	#include <stdio.h>
     2	
     3	main(argc, argv)
     4		int argc;
     5		char **argv;
     6	{
     7		unsigned num;
     8	
     9		if (argc < 2) {
    10			fprintf(stderr, "usage: rnusers <hostname>\n");
    11			exit(1);
    12		}
    13		if ((num = rnusers(argv[1])) < 0 ) {
    14			fprintf(stderr, "error: rnusers\n");
    15			exit(-1);
    16		}
    17		printf("%d users on %s\n", num, argv[1]);
    18		exit(0);
    19	}

How is the relational operator in line 13 supposed to work with the
variable declared in line 7?  It sure doesn't work right on my systems.

David D. Stubbs - Tektronix, Inc.



More information about the Comp.sys.sun mailing list