| @@ -99,7 +99,7 @@ mountfactotum(void) · 98 unmodified lines |
| 99 | void | 99 | void |
| 100 | cpumain(int argc, char **argv) | 100 | cpumain(int argc, char **argv) |
| 101 | { | 101 | { |
| 102 | char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *p, *err, *secstoreserver, *s; | 102 | char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *err, *secstoreserver, *s; |
| 103 | int fd, ms, data; | 103 | int fd, ms, data; |
| 104 | | 104 | |
| 105 | /* see if we should use a larger message size */ | 105 | /* see if we should use a larger message size */ |
| @@ -115,6 +115,12 @@ cpumain(int argc, char **argv) · 9 unmodified lines |
| 115 | if(user == nil) | 115 | if(user == nil) |
| 116 | user = readcons("user", nil, 0); | 116 | user = readcons("user", nil, 0); |
| 117 | secstoreserver = nil; | 117 | secstoreserver = nil; |
| | 118 | authserver = getenv("auth"); |
| | 119 | if(authserver == nil) |
| | 120 | authserver = "auth"; |
| | 121 | system = getenv("cpu"); |
| | 122 | if(system == nil) |
| | 123 | system = "cpu"; |
| 118 | ARGBEGIN{ | 124 | ARGBEGIN{ |
| 119 | case 'a': | 125 | case 'a': |
| 120 | authserver = EARGF(usage()); | 126 | authserver = EARGF(usage()); |
| @@ -154,6 +160,9 @@ cpumain(int argc, char **argv) · 33 unmodified lines |
| 154 | usage(); | 160 | usage(); |
| 155 | }ARGEND; | 161 | }ARGEND; |
| 156 | | 162 | |
| | 163 | if(argc != 0) |
| | 164 | usage(); |
| | 165 | |
| 157 | if(mountfactotum() < 0){ | 166 | if(mountfactotum() < 0){ |
| 158 | if(secstoreserver == nil) | 167 | if(secstoreserver == nil) |
| 159 | secstoreserver = authserver; | 168 | secstoreserver = authserver; |
| @@ -167,23 +176,6 @@ cpumain(int argc, char **argv) · 7 unmodified lines |
| 167 | } | 176 | } |
| 168 | } | 177 | } |
| 169 | | 178 | |
| 170 | if(argc != 0) | | |
| 171 | usage(); | | |
| 172 | | | |
| 173 | if(system == nil) { | | |
| 174 | p = getenv("cpu"); | | |
| 175 | if(p == 0) | | |
| 176 | fatal(0, "set $cpu"); | | |
| 177 | system = p; | | |
| 178 | } | | |
| 179 | | | |
| 180 | if(authserver == nil) { | | |
| 181 | p = getenv("auth"); | | |
| 182 | if(p == 0) | | |
| 183 | fatal(0, "set $auth"); | | |
| 184 | authserver = p; | | |
| 185 | } | | |
| 186 | | | |
| 187 | if((err = rexcall(&data, system, srvname))) | 179 | if((err = rexcall(&data, system, srvname))) |
| 188 | fatal(1, "%s: %s", err, system); | 180 | fatal(1, "%s: %s", err, system); |
| 189 | | 181 | |