1 | Index: c/src/libnetworking/libc//Makefile.am |
---|
2 | =================================================================== |
---|
3 | RCS file: /afs/slac/g/spear/cvsrep/rtems/src/c/src/libnetworking/libc/Makefile.am,v |
---|
4 | retrieving revision 1.1.1.1 |
---|
5 | diff -c -r1.1.1.1 Makefile.am |
---|
6 | *** c/src/libnetworking/libc//Makefile.am 2001/12/14 22:53:33 1.1.1.1 |
---|
7 | --- c/src/libnetworking/libc//Makefile.am 2002/03/12 22:33:08 |
---|
8 | *************** |
---|
9 | *** 15,21 **** |
---|
10 | inet_pton.c linkaddr.c map_v4v6.c nsap_addr.c ns_name.c ns_netint.c \ |
---|
11 | ns_parse.c ns_print.c ns_ttl.c res_comp.c res_data.c res_debug.c \ |
---|
12 | res_init.c res_mkquery.c res_mkupdate.c res_query.c res_send.c \ |
---|
13 | ! res_stubs.c res_update.c strsep.c |
---|
14 | C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o) |
---|
15 | |
---|
16 | OBJS = $(C_O_FILES) |
---|
17 | --- 15,21 ---- |
---|
18 | inet_pton.c linkaddr.c map_v4v6.c nsap_addr.c ns_name.c ns_netint.c \ |
---|
19 | ns_parse.c ns_print.c ns_ttl.c res_comp.c res_data.c res_debug.c \ |
---|
20 | res_init.c res_mkquery.c res_mkupdate.c res_query.c res_send.c \ |
---|
21 | ! res_stubs.c res_update.c strsep.c rcmd.c |
---|
22 | C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o) |
---|
23 | |
---|
24 | OBJS = $(C_O_FILES) |
---|
25 | Index: c/src/libnetworking/libc//rcmd.c |
---|
26 | =================================================================== |
---|
27 | RCS file: /afs/slac/g/spear/cvsrep/rtems/src/c/src/libnetworking/libc/rcmd.c,v |
---|
28 | retrieving revision 1.1.1.1 |
---|
29 | diff -c -r1.1.1.1 rcmd.c |
---|
30 | *** c/src/libnetworking/libc//rcmd.c 2001/12/14 22:53:37 1.1.1.1 |
---|
31 | --- c/src/libnetworking/libc//rcmd.c 2002/03/20 00:25:18 |
---|
32 | *************** |
---|
33 | *** 59,71 **** |
---|
34 | #include <rpcsvc/ypclnt.h> |
---|
35 | #endif |
---|
36 | |
---|
37 | - extern int innetgr __P(( const char *, const char *, const char *, const char * )); |
---|
38 | |
---|
39 | #define max(a, b) ((a > b) ? a : b) |
---|
40 | |
---|
41 | int __ivaliduser __P((FILE *, u_long, const char *, const char *)); |
---|
42 | static int __icheckhost __P((u_long, char *)); |
---|
43 | |
---|
44 | int |
---|
45 | rcmd(ahost, rport, locuser, remuser, cmd, fd2p) |
---|
46 | char **ahost; |
---|
47 | --- 59,81 ---- |
---|
48 | #include <rpcsvc/ypclnt.h> |
---|
49 | #endif |
---|
50 | |
---|
51 | |
---|
52 | #define max(a, b) ((a > b) ? a : b) |
---|
53 | |
---|
54 | + #ifdef __rtems |
---|
55 | + int rresvport(); |
---|
56 | + #define bzero(a,s) memset((a),0,(s)) |
---|
57 | + #define bcmp memcmp |
---|
58 | + #define bcopy(s,d,i) memcpy(d,s,i) |
---|
59 | + #else /* __rtems */ |
---|
60 | + |
---|
61 | + extern int innetgr __P(( const char *, const char *, const char *, const char * )); |
---|
62 | + |
---|
63 | int __ivaliduser __P((FILE *, u_long, const char *, const char *)); |
---|
64 | static int __icheckhost __P((u_long, char *)); |
---|
65 | |
---|
66 | + #endif |
---|
67 | + |
---|
68 | int |
---|
69 | rcmd(ahost, rport, locuser, remuser, cmd, fd2p) |
---|
70 | char **ahost; |
---|
71 | *************** |
---|
72 | *** 76,82 **** |
---|
73 | --- 86,94 ---- |
---|
74 | struct hostent *hp; |
---|
75 | struct sockaddr_in sin, from; |
---|
76 | fd_set reads; |
---|
77 | + #ifndef __rtems |
---|
78 | long oldmask; |
---|
79 | + #endif |
---|
80 | pid_t pid; |
---|
81 | int s, lport, timo; |
---|
82 | char c; |
---|
83 | *************** |
---|
84 | *** 88,94 **** |
---|
85 | --- 100,108 ---- |
---|
86 | return (-1); |
---|
87 | } |
---|
88 | *ahost = hp->h_name; |
---|
89 | + #ifndef __rtems |
---|
90 | oldmask = sigblock(sigmask(SIGURG)); |
---|
91 | + #endif |
---|
92 | for (timo = 1, lport = IPPORT_RESERVED - 1;;) { |
---|
93 | s = rresvport(&lport); |
---|
94 | if (s < 0) { |
---|
95 | *************** |
---|
96 | *** 98,104 **** |
---|
97 | --- 112,120 ---- |
---|
98 | else |
---|
99 | (void)fprintf(stderr, "rcmd: socket: %s\n", |
---|
100 | strerror(errno)); |
---|
101 | + #ifndef __rtems |
---|
102 | sigsetmask(oldmask); |
---|
103 | + #endif |
---|
104 | return (-1); |
---|
105 | } |
---|
106 | fcntl(s, F_SETOWN, pid); |
---|
107 | *************** |
---|
108 | *** 133,139 **** |
---|
109 | --- 149,157 ---- |
---|
110 | continue; |
---|
111 | } |
---|
112 | (void)fprintf(stderr, "%s: %s\n", hp->h_name, strerror(errno)); |
---|
113 | + #ifndef __rtems |
---|
114 | sigsetmask(oldmask); |
---|
115 | + #endif |
---|
116 | return (-1); |
---|
117 | } |
---|
118 | lport--; |
---|
119 | *************** |
---|
120 | *** 221,234 **** |
---|
121 | --- 239,256 ---- |
---|
122 | } |
---|
123 | goto bad2; |
---|
124 | } |
---|
125 | + #ifndef __rtems |
---|
126 | sigsetmask(oldmask); |
---|
127 | + #endif |
---|
128 | return (s); |
---|
129 | bad2: |
---|
130 | if (lport) |
---|
131 | (void)close(*fd2p); |
---|
132 | bad: |
---|
133 | (void)close(s); |
---|
134 | + #ifndef __rtems |
---|
135 | sigsetmask(oldmask); |
---|
136 | + #endif |
---|
137 | return (-1); |
---|
138 | } |
---|
139 | |
---|
140 | *************** |
---|
141 | *** 264,269 **** |
---|
142 | --- 286,292 ---- |
---|
143 | return (s); |
---|
144 | } |
---|
145 | |
---|
146 | + #ifndef __rtems |
---|
147 | int __check_rhosts_file = 1; |
---|
148 | char *__rcmd_errstr; |
---|
149 | |
---|
150 | *************** |
---|
151 | *** 518,520 **** |
---|
152 | --- 541,544 ---- |
---|
153 | /* No match. */ |
---|
154 | return (0); |
---|
155 | } |
---|
156 | + #endif |
---|