rprintmsg.c (1906) | rprintmsg.c (8875) |
---|---|
1/* @(#)rprintmsg.c 2.1 88/08/11 4.0 RPCSRC */ 2/* 3 * rprintmsg.c: remote version of "printmsg.c" 4 */ 5#include <stdio.h> 6#include <rpc/rpc.h> /* always need this */ 7#include "msg.h" /* need this too: will be generated by rpcgen*/ 8 --- 26 unchanged lines hidden (view full) --- 35 if (cl == NULL) { 36 /* 37 * Couldn't establish connection with server. 38 * Print error message and die. 39 */ 40 clnt_pcreateerror(server); 41 exit(1); 42 } | 1/* @(#)rprintmsg.c 2.1 88/08/11 4.0 RPCSRC */ 2/* 3 * rprintmsg.c: remote version of "printmsg.c" 4 */ 5#include <stdio.h> 6#include <rpc/rpc.h> /* always need this */ 7#include "msg.h" /* need this too: will be generated by rpcgen*/ 8 --- 26 unchanged lines hidden (view full) --- 35 if (cl == NULL) { 36 /* 37 * Couldn't establish connection with server. 38 * Print error message and die. 39 */ 40 clnt_pcreateerror(server); 41 exit(1); 42 } |
43 | 43 |
44 /* 45 * Call the remote procedure "printmessage" on the server 46 */ 47 result = printmessage_1(&message, cl); 48 if (result == NULL) { 49 /* | 44 /* 45 * Call the remote procedure "printmessage" on the server 46 */ 47 result = printmessage_1(&message, cl); 48 if (result == NULL) { 49 /* |
50 * An error occurred while calling the server. | 50 * An error occurred while calling the server. |
51 * Print error message and die. 52 */ 53 clnt_perror(cl, server); 54 exit(1); 55 } 56 57 /* 58 * Okay, we successfully called the remote procedure. 59 */ 60 if (*result == 0) { 61 /* | 51 * Print error message and die. 52 */ 53 clnt_perror(cl, server); 54 exit(1); 55 } 56 57 /* 58 * Okay, we successfully called the remote procedure. 59 */ 60 if (*result == 0) { 61 /* |
62 * Server was unable to print our message. | 62 * Server was unable to print our message. |
63 * Print error message and die. 64 */ | 63 * Print error message and die. 64 */ |
65 fprintf(stderr, "%s: sorry, %s couldn't print your message\n", 66 argv[0], server); | 65 fprintf(stderr, "%s: sorry, %s couldn't print your message\n", 66 argv[0], server); |
67 exit(1); | 67 exit(1); |
68 } | 68 } |
69 70 /* 71 * The message got printed on the server's console 72 */ 73 printf("Message delivered to %s!\n", server); 74} | 69 70 /* 71 * The message got printed on the server's console 72 */ 73 printf("Message delivered to %s!\n", server); 74} |