Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | Upstream-Status: Inappropriate [1] |
| 2 | |
| 3 | [1] Not the author, the patch is from: |
| 4 | http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm |
| 5 | |
| 6 | --- rdist-6.1.5/src/gram.y.cleanup 2003-12-17 11:38:16.000000000 +0100 |
| 7 | +++ rdist-6.1.5/src/gram.y 2003-12-17 11:38:16.000000000 +0100 |
| 8 | @@ -40,7 +40,7 @@ |
| 9 | * SUCH DAMAGE. |
| 10 | */ |
| 11 | |
| 12 | -#ifndef lint |
| 13 | +#if 0 |
| 14 | static char RCSid[] = |
| 15 | "$Id: gram.y,v 6.30 1998/11/10 04:10:42 mcooper Exp $"; |
| 16 | |
| 17 | @@ -170,7 +170,7 @@ |
| 18 | ; |
| 19 | |
| 20 | cmd: INSTALL options opt_namelist ';' { |
| 21 | - register struct namelist *nl; |
| 22 | + struct namelist *nl; |
| 23 | |
| 24 | $1->sc_options = $2 | options; |
| 25 | if ($3 != NULL) { |
| 26 | @@ -240,11 +240,11 @@ |
| 27 | int yylineno = 1; |
| 28 | extern FILE *fin; |
| 29 | |
| 30 | -yylex() |
| 31 | +int yylex() |
| 32 | { |
| 33 | static char yytext[INMAX]; |
| 34 | - register int c; |
| 35 | - register char *cp1, *cp2; |
| 36 | + int c; |
| 37 | + char *cp1, *cp2; |
| 38 | static char quotechars[] = "[]{}*?$"; |
| 39 | |
| 40 | again: |
| 41 | @@ -409,8 +409,8 @@ |
| 42 | * some of the characters we use. |
| 43 | */ |
| 44 | extern int any(c, str) |
| 45 | - register int c; |
| 46 | - register char *str; |
| 47 | + int c; |
| 48 | + char *str; |
| 49 | { |
| 50 | while (*str) |
| 51 | if (c == *str++) |
| 52 | @@ -421,13 +421,14 @@ |
| 53 | /* |
| 54 | * Insert or append ARROW command to list of hosts to be updated. |
| 55 | */ |
| 56 | +void |
| 57 | insert(label, files, hosts, subcmds) |
| 58 | char *label; |
| 59 | struct namelist *files, *hosts; |
| 60 | struct subcmd *subcmds; |
| 61 | { |
| 62 | - register struct cmd *c, *prev, *nc; |
| 63 | - register struct namelist *h, *lasth; |
| 64 | + struct cmd *c, *prev, *nc; |
| 65 | + struct namelist *h, *lasth; |
| 66 | |
| 67 | debugmsg(DM_CALL, "insert(%s, %x, %x, %x) start, files = %s", |
| 68 | label == NULL ? "(null)" : label, |
| 69 | @@ -475,13 +476,14 @@ |
| 70 | * Append DCOLON command to the end of the command list since these are always |
| 71 | * executed in the order they appear in the distfile. |
| 72 | */ |
| 73 | +void |
| 74 | append(label, files, stamp, subcmds) |
| 75 | char *label; |
| 76 | struct namelist *files; |
| 77 | char *stamp; |
| 78 | struct subcmd *subcmds; |
| 79 | { |
| 80 | - register struct cmd *c; |
| 81 | + struct cmd *c; |
| 82 | |
| 83 | c = ALLOC(cmd); |
| 84 | c->c_type = DCOLON; |
| 85 | @@ -501,6 +503,7 @@ |
| 86 | /* |
| 87 | * Error printing routine in parser. |
| 88 | */ |
| 89 | +void |
| 90 | yyerror(s) |
| 91 | char *s; |
| 92 | { |
| 93 | @@ -530,7 +533,7 @@ |
| 94 | makenl(name) |
| 95 | char *name; |
| 96 | { |
| 97 | - register struct namelist *nl; |
| 98 | + struct namelist *nl; |
| 99 | |
| 100 | debugmsg(DM_CALL, "makenl(%s)", name == NULL ? "null" : name); |
| 101 | |
| 102 | @@ -627,7 +630,7 @@ |
| 103 | makesubcmd(type) |
| 104 | int type; |
| 105 | { |
| 106 | - register struct subcmd *sc; |
| 107 | + struct subcmd *sc; |
| 108 | |
| 109 | sc = ALLOC(subcmd); |
| 110 | sc->sc_type = type; |
| 111 | --- rdist-6.1.5/src/rdist.c.cleanup 1998-11-10 05:13:50.000000000 +0100 |
| 112 | +++ rdist-6.1.5/src/rdist.c 2003-12-17 11:38:16.000000000 +0100 |
| 113 | @@ -38,7 +38,7 @@ |
| 114 | * SUCH DAMAGE. |
| 115 | */ |
| 116 | |
| 117 | -#ifndef lint |
| 118 | +#if 0 |
| 119 | static char RCSid[] = |
| 120 | "$Id: rdist.c,v 6.66 1998/11/10 04:13:49 mcooper Exp $"; |
| 121 | |
| 122 | @@ -80,7 +80,7 @@ |
| 123 | char *name; |
| 124 | struct namelist **hostlist; |
| 125 | { |
| 126 | - register struct namelist *ptr, *new; |
| 127 | + struct namelist *ptr, *new; |
| 128 | |
| 129 | if (!name || !hostlist) |
| 130 | return; |
| 131 | @@ -97,14 +97,15 @@ |
| 132 | *hostlist = new; |
| 133 | } |
| 134 | |
| 135 | +int |
| 136 | main(argc, argv, envp) |
| 137 | int argc; |
| 138 | char *argv[]; |
| 139 | char **envp; |
| 140 | { |
| 141 | struct namelist *hostlist = NULL; |
| 142 | - register int x; |
| 143 | - register char *cp; |
| 144 | + int x; |
| 145 | + char *cp; |
| 146 | int cmdargs = 0; |
| 147 | int c; |
| 148 | |
| 149 | @@ -114,7 +115,7 @@ |
| 150 | */ |
| 151 | setprogname(argv); |
| 152 | |
| 153 | - if (cp = msgparseopts(localmsglist, TRUE)) { |
| 154 | + if ((cp = msgparseopts(localmsglist, TRUE))) { |
| 155 | error("Bad builtin log option (%s): %s.", |
| 156 | localmsglist, cp); |
| 157 | usage(); |
| 158 | @@ -158,7 +159,7 @@ |
| 159 | while ((c = getopt(argc, argv, optchars)) != -1) |
| 160 | switch (c) { |
| 161 | case 'l': |
| 162 | - if (cp = msgparseopts(optarg, TRUE)) { |
| 163 | + if ((cp = msgparseopts(optarg, TRUE))) { |
| 164 | error("Bad log option \"%s\": %s.", optarg,cp); |
| 165 | usage(); |
| 166 | } |
| 167 | @@ -206,7 +207,7 @@ |
| 168 | |
| 169 | case 'D': |
| 170 | debug = DM_ALL; |
| 171 | - if (cp = msgparseopts("stdout=all,debug", TRUE)) { |
| 172 | + if ((cp = msgparseopts("stdout=all,debug", TRUE))) { |
| 173 | error("Enable debug messages failed: %s.", cp); |
| 174 | usage(); |
| 175 | } |
| 176 | @@ -245,7 +246,7 @@ |
| 177 | error("No path specified to \"-P\"."); |
| 178 | usage(); |
| 179 | } |
| 180 | - if (cp = searchpath(optarg)) |
| 181 | + if ((cp = searchpath(optarg))) |
| 182 | path_remsh = strdup(cp); |
| 183 | else { |
| 184 | error("No component of path \"%s\" exists.", |
| 185 | @@ -297,7 +298,7 @@ |
| 186 | else { |
| 187 | if (fin == NULL) |
| 188 | fin = opendist(distfile); |
| 189 | - (void) yyparse(); |
| 190 | + yyparse(); |
| 191 | /* |
| 192 | * Need to keep stdin open for child processing later |
| 193 | */ |
| 194 | @@ -348,6 +349,7 @@ |
| 195 | /* |
| 196 | * Print usage message and exit. |
| 197 | */ |
| 198 | +void |
| 199 | usage() |
| 200 | { |
| 201 | char *sopts = "cDFnv"; |
| 202 | @@ -379,12 +381,13 @@ |
| 203 | /* |
| 204 | * rcp like interface for distributing files. |
| 205 | */ |
| 206 | +void |
| 207 | docmdargs(nargs, args) |
| 208 | int nargs; |
| 209 | char *args[]; |
| 210 | { |
| 211 | - register struct namelist *nl, *prev; |
| 212 | - register char *cp; |
| 213 | + struct namelist *nl, *prev; |
| 214 | + char *cp; |
| 215 | struct namelist *files, *hosts; |
| 216 | struct subcmd *cmds; |
| 217 | char *dest; |
| 218 | @@ -433,10 +436,10 @@ |
| 219 | * Get a list of NAME blocks (mostly for debugging). |
| 220 | */ |
| 221 | extern char *getnlstr(nl) |
| 222 | - register struct namelist *nl; |
| 223 | + struct namelist *nl; |
| 224 | { |
| 225 | static char buf[16384]; |
| 226 | - register int count = 0, len = 0; |
| 227 | + int count = 0, len = 0; |
| 228 | |
| 229 | (void) sprintf(buf, "("); |
| 230 | |
| 231 | --- rdist-6.1.5/src/client.c.cleanup 2003-12-17 11:38:16.000000000 +0100 |
| 232 | +++ rdist-6.1.5/src/client.c 2003-12-17 11:38:16.000000000 +0100 |
| 233 | @@ -38,7 +38,7 @@ |
| 234 | * SUCH DAMAGE. |
| 235 | */ |
| 236 | |
| 237 | -#ifndef lint |
| 238 | +#if 0 |
| 239 | static char RCSid[] = |
| 240 | "$Id: client.c,v 6.82 1998/11/10 04:08:47 mcooper Exp $"; |
| 241 | |
| 242 | @@ -84,7 +84,7 @@ |
| 243 | int destdir; |
| 244 | { |
| 245 | extern struct namelist *filelist; |
| 246 | - register char *lname, *cp; |
| 247 | + char *lname, *cp; |
| 248 | static char buff[BUFSIZ]; |
| 249 | int srclen, pathlen; |
| 250 | char *p; |
| 251 | @@ -146,7 +146,7 @@ |
| 252 | struct namelist *list; |
| 253 | char *file; |
| 254 | { |
| 255 | - register struct namelist *nl; |
| 256 | + struct namelist *nl; |
| 257 | |
| 258 | for (nl = list; nl != NULL; nl = nl->n_next) |
| 259 | if (strcmp(file, nl->n_name) == 0) |
| 260 | @@ -163,7 +163,7 @@ |
| 261 | char *rname; |
| 262 | int destdir; |
| 263 | { |
| 264 | - register struct subcmd *sc; |
| 265 | + struct subcmd *sc; |
| 266 | extern struct subcmd *subcmds; |
| 267 | char *rfile; |
| 268 | |
| 269 | @@ -200,7 +200,7 @@ |
| 270 | { |
| 271 | char *rfile; |
| 272 | struct namelist *new; |
| 273 | - register struct subcmd *sc; |
| 274 | + struct subcmd *sc; |
| 275 | extern struct subcmd *subcmds; |
| 276 | int isokay = 0; |
| 277 | |
| 278 | @@ -227,7 +227,7 @@ |
| 279 | */ |
| 280 | static void freecmdspecialfiles() |
| 281 | { |
| 282 | - register struct namelist *ptr, *save; |
| 283 | + struct namelist *ptr, *save; |
| 284 | |
| 285 | for (ptr = updfilelist; ptr; ) { |
| 286 | if (ptr->n_name) (void) free(ptr->n_name); |
| 287 | @@ -249,10 +249,8 @@ |
| 288 | char **filev; |
| 289 | opt_t opts; |
| 290 | { |
| 291 | - register struct subcmd *sc; |
| 292 | - register struct namelist *f; |
| 293 | - register char **cpp; |
| 294 | - char *file; |
| 295 | + struct subcmd *sc; |
| 296 | + struct namelist *f; |
| 297 | int first = TRUE; |
| 298 | |
| 299 | for (sc = cmd->c_cmds; sc != NULL; sc = sc->sc_next) { |
| 300 | @@ -294,7 +292,7 @@ |
| 301 | int checkfilename(name) |
| 302 | char *name; |
| 303 | { |
| 304 | - register char *cp; |
| 305 | + char *cp; |
| 306 | |
| 307 | if (strchr(name, '\n')) { |
| 308 | for (cp = name; *cp; cp++) |
| 309 | @@ -501,7 +499,7 @@ |
| 310 | static int rmchk(opts) |
| 311 | opt_t opts; |
| 312 | { |
| 313 | - register u_char *s; |
| 314 | + u_char *s; |
| 315 | struct stat stb; |
| 316 | int didupdate = 0; |
| 317 | int n; |
| 318 | @@ -618,7 +616,7 @@ |
| 319 | |
| 320 | optarget = ptarget; |
| 321 | len = ptarget - target; |
| 322 | - while (dp = readdir(d)) { |
| 323 | + while ((dp = readdir(d))) { |
| 324 | if (!strcmp(dp->d_name, ".") || |
| 325 | !strcmp(dp->d_name, "..")) |
| 326 | continue; |
| 327 | @@ -631,7 +629,7 @@ |
| 328 | if (ptarget[-1] != '/') |
| 329 | *ptarget++ = '/'; |
| 330 | cp = dp->d_name; |
| 331 | - while (*ptarget++ = *cp++) |
| 332 | + while ((*ptarget++ = *cp++)) |
| 333 | ; |
| 334 | ptarget--; |
| 335 | if (sendit(dp->d_name, opts, destdir) > 0) |
| 336 | @@ -770,13 +768,13 @@ |
| 337 | opt_t opts; |
| 338 | struct stat *statp; |
| 339 | { |
| 340 | - register off_t size; |
| 341 | - register time_t mtime; |
| 342 | + off_t size; |
| 343 | + time_t mtime; |
| 344 | unsigned short lmode; |
| 345 | unsigned short rmode; |
| 346 | char *owner = NULL, *group = NULL; |
| 347 | int done, n; |
| 348 | - u_char *cp; |
| 349 | + char *cp; |
| 350 | |
| 351 | debugmsg(DM_CALL, "update(%s, 0x%x, 0x%x)\n", rname, opts, statp); |
| 352 | |
| 353 | @@ -1035,7 +1033,6 @@ |
| 354 | int destdir; |
| 355 | { |
| 356 | static struct stat stb; |
| 357 | - extern struct subcmd *subcmds; |
| 358 | char *user, *group; |
| 359 | int u, len; |
| 360 | int didupdate = 0; |
| 361 | @@ -1157,7 +1154,7 @@ |
| 362 | (void) unlink(statfile); |
| 363 | #endif |
| 364 | |
| 365 | - if (file = getnotifyfile()) |
| 366 | + if ((file = getnotifyfile())) |
| 367 | (void) unlink(file); |
| 368 | } |
| 369 | |
| 370 | --- rdist-6.1.5/src/child.c.cleanup 1998-11-10 05:18:57.000000000 +0100 |
| 371 | +++ rdist-6.1.5/src/child.c 2003-12-17 11:38:16.000000000 +0100 |
| 372 | @@ -38,7 +38,7 @@ |
| 373 | * SUCH DAMAGE. |
| 374 | */ |
| 375 | |
| 376 | -#ifndef lint |
| 377 | +#if 0 |
| 378 | static char RCSid[] = |
| 379 | "$Id: child.c,v 6.29 1998/11/10 04:18:56 mcooper Exp $"; |
| 380 | |
| 381 | @@ -90,7 +90,7 @@ |
| 382 | static void removechild(child) |
| 383 | CHILD *child; |
| 384 | { |
| 385 | - register CHILD *pc, *prevpc; |
| 386 | + CHILD *pc, *prevpc; |
| 387 | |
| 388 | debugmsg(DM_CALL, "removechild(%s, %d, %d) start", |
| 389 | child->c_name, child->c_pid, child->c_readfd); |
| 390 | @@ -148,7 +148,7 @@ |
| 391 | static CHILD *copychild(child) |
| 392 | CHILD *child; |
| 393 | { |
| 394 | - register CHILD *newc; |
| 395 | + CHILD *newc; |
| 396 | |
| 397 | newc = (CHILD *) xmalloc(sizeof(CHILD)); |
| 398 | |
| 399 | @@ -167,7 +167,7 @@ |
| 400 | static void addchild(child) |
| 401 | CHILD *child; |
| 402 | { |
| 403 | - register CHILD *pc; |
| 404 | + CHILD *pc; |
| 405 | |
| 406 | debugmsg(DM_CALL, "addchild() start\n"); |
| 407 | |
| 408 | @@ -280,7 +280,7 @@ |
| 409 | */ |
| 410 | static void reap() |
| 411 | { |
| 412 | - register CHILD *pc; |
| 413 | + CHILD *pc; |
| 414 | int status = 0; |
| 415 | pid_t pid; |
| 416 | |
| 417 | @@ -336,7 +336,7 @@ |
| 418 | */ |
| 419 | static void childscan() |
| 420 | { |
| 421 | - register CHILD *pc, *nextpc; |
| 422 | + CHILD *pc, *nextpc; |
| 423 | |
| 424 | debugmsg(DM_CALL, "childscan() start"); |
| 425 | |
| 426 | @@ -366,8 +366,8 @@ |
| 427 | extern void waitup() |
| 428 | { |
| 429 | #if defined(HAVE_SELECT) |
| 430 | - register int count; |
| 431 | - register CHILD *pc; |
| 432 | + int count; |
| 433 | + CHILD *pc; |
| 434 | fd_set rchildfds; |
| 435 | |
| 436 | debugmsg(DM_CALL, "waitup() start\n"); |
| 437 | --- rdist-6.1.5/src/docmd.c.cleanup 2003-12-17 11:38:16.000000000 +0100 |
| 438 | +++ rdist-6.1.5/src/docmd.c 2003-12-17 11:38:16.000000000 +0100 |
| 439 | @@ -38,7 +38,7 @@ |
| 440 | * SUCH DAMAGE. |
| 441 | */ |
| 442 | |
| 443 | -#ifndef lint |
| 444 | +#if 0 |
| 445 | static char RCSid[] = |
| 446 | "$Id: docmd.c,v 6.87 1998/11/10 04:08:32 mcooper Exp $"; |
| 447 | |
| 448 | @@ -99,10 +99,10 @@ |
| 449 | */ |
| 450 | static void notify(rhost, to, lmod) |
| 451 | char *rhost; |
| 452 | - register struct namelist *to; |
| 453 | + struct namelist *to; |
| 454 | time_t lmod; |
| 455 | { |
| 456 | - register int fd, len; |
| 457 | + int fd, len; |
| 458 | FILE *pf, *popen(); |
| 459 | struct stat stb; |
| 460 | static char buf[BUFSIZ]; |
| 461 | @@ -221,7 +221,7 @@ |
| 462 | struct cmd *cmd; |
| 463 | struct cmd *cmdlist; |
| 464 | { |
| 465 | - register struct cmd *pcmd; |
| 466 | + struct cmd *pcmd; |
| 467 | |
| 468 | for (pcmd = cmdlist; pcmd; pcmd = pcmd->c_next) { |
| 469 | checkcmd(pcmd); |
| 470 | @@ -238,7 +238,7 @@ |
| 471 | struct cmd *cmd; |
| 472 | struct cmd *cmdlist; |
| 473 | { |
| 474 | - register struct cmd *pc; |
| 475 | + struct cmd *pc; |
| 476 | |
| 477 | if (!cmd) { |
| 478 | debugmsg(DM_MISC, "markfailed() NULL cmd parameter"); |
| 479 | @@ -309,7 +309,7 @@ |
| 480 | static int makeconn(rhost) |
| 481 | char *rhost; |
| 482 | { |
| 483 | - register char *ruser, *cp; |
| 484 | + char *ruser, *cp; |
| 485 | static char *cur_host = NULL; |
| 486 | extern char *locuser; |
| 487 | extern long min_freefiles, min_freespace; |
| 488 | @@ -430,9 +430,9 @@ |
| 489 | struct cmd *cmd; |
| 490 | char **filev; |
| 491 | { |
| 492 | - register struct namelist *f; |
| 493 | - register struct subcmd *sc; |
| 494 | - register char **cpp; |
| 495 | + struct namelist *f; |
| 496 | + struct subcmd *sc; |
| 497 | + char **cpp; |
| 498 | int n, ddir, destdir, opts = options; |
| 499 | struct namelist *files; |
| 500 | struct subcmd *sbcmds; |
| 501 | @@ -567,7 +567,6 @@ |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | -done: |
| 506 | /* |
| 507 | * Run any commands for the entire cmd |
| 508 | */ |
| 509 | @@ -584,7 +583,7 @@ |
| 510 | notify(rhost, sc->sc_args, (time_t) 0); |
| 511 | |
| 512 | if (!nflag) { |
| 513 | - register struct linkbuf *nextl, *l; |
| 514 | + struct linkbuf *nextl, *l; |
| 515 | |
| 516 | for (l = ihead; l != NULL; freelinkinfo(l), l = nextl) { |
| 517 | nextl = l->nextp; |
| 518 | @@ -601,11 +600,12 @@ |
| 519 | setjmp_ok = FALSE; |
| 520 | } |
| 521 | |
| 522 | +int |
| 523 | okname(name) |
| 524 | - register char *name; |
| 525 | + char *name; |
| 526 | { |
| 527 | - register char *cp = name; |
| 528 | - register int c, isbad; |
| 529 | + char *cp = name; |
| 530 | + int c, isbad; |
| 531 | |
| 532 | for (isbad = FALSE; *cp && !isbad; ++cp) { |
| 533 | c = *cp; |
| 534 | @@ -627,9 +627,9 @@ |
| 535 | struct subcmd *sbcmds; |
| 536 | char **env; |
| 537 | { |
| 538 | - register DIR *d; |
| 539 | - register DIRENTRY *dp; |
| 540 | - register char *cp; |
| 541 | + DIR *d; |
| 542 | + DIRENTRY *dp; |
| 543 | + char *cp; |
| 544 | char *optarget; |
| 545 | int len; |
| 546 | |
| 547 | @@ -641,7 +641,7 @@ |
| 548 | } |
| 549 | optarget = ptarget; |
| 550 | len = ptarget - target; |
| 551 | - while (dp = readdir(d)) { |
| 552 | + while ((dp = readdir(d))) { |
| 553 | if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) |
| 554 | continue; |
| 555 | if (len + 1 + (int)strlen(dp->d_name) >= BUFSIZ - 1) { |
| 556 | @@ -651,7 +651,7 @@ |
| 557 | ptarget = optarget; |
| 558 | *ptarget++ = '/'; |
| 559 | cp = dp->d_name; |
| 560 | - while (*ptarget++ = *cp++) |
| 561 | + while ((*ptarget++ = *cp++)) |
| 562 | ; |
| 563 | ptarget--; |
| 564 | cmptime(target, sbcmds, env); |
| 565 | @@ -740,9 +740,9 @@ |
| 566 | struct cmd *cmd; |
| 567 | char **filev; |
| 568 | { |
| 569 | - register struct subcmd *sc; |
| 570 | - register struct namelist *f; |
| 571 | - register char *cp, **cpp; |
| 572 | + struct subcmd *sc; |
| 573 | + struct namelist *f; |
| 574 | + char *cp, **cpp; |
| 575 | struct stat stb; |
| 576 | struct namelist *files = cmd->c_files; |
| 577 | struct subcmd *sbcmds = cmd->c_cmds; |
| 578 | @@ -824,8 +824,8 @@ |
| 579 | extern int except(file) |
| 580 | char *file; |
| 581 | { |
| 582 | - register struct subcmd *sc; |
| 583 | - register struct namelist *nl; |
| 584 | + struct subcmd *sc; |
| 585 | + struct namelist *nl; |
| 586 | |
| 587 | debugmsg(DM_CALL, "except(%s)", file); |
| 588 | |
| 589 | @@ -918,8 +918,8 @@ |
| 590 | int argc; |
| 591 | char **argv; |
| 592 | { |
| 593 | - register struct namelist *f; |
| 594 | - register int i; |
| 595 | + struct namelist *f; |
| 596 | + int i; |
| 597 | |
| 598 | if (argc) { |
| 599 | for (i = 0; i < argc; i++) { |
| 600 | @@ -962,9 +962,9 @@ |
| 601 | int argc; |
| 602 | char **argv; |
| 603 | { |
| 604 | - register struct cmd *c; |
| 605 | - register char *cp; |
| 606 | - register int i; |
| 607 | + struct cmd *c; |
| 608 | + char *cp; |
| 609 | + int i; |
| 610 | |
| 611 | (void) signal(SIGHUP, sighandler); |
| 612 | (void) signal(SIGINT, sighandler); |
| 613 | @@ -1032,7 +1032,7 @@ |
| 614 | |
| 615 | if (hostlist) { |
| 616 | /* Do specific hosts as specified on command line */ |
| 617 | - register struct namelist *nlptr; |
| 618 | + struct namelist *nlptr; |
| 619 | |
| 620 | for (nlptr = hostlist; nlptr; nlptr = nlptr->n_next) |
| 621 | /* |
| 622 | --- rdist-6.1.5/src/distopt.c.cleanup 1998-11-10 05:09:11.000000000 +0100 |
| 623 | +++ rdist-6.1.5/src/distopt.c 2003-12-17 11:38:16.000000000 +0100 |
| 624 | @@ -6,7 +6,7 @@ |
| 625 | * appropriately. |
| 626 | */ |
| 627 | |
| 628 | -#ifndef lint |
| 629 | +#if 0 |
| 630 | static char RCSid[] = |
| 631 | "$Id: distopt.c,v 6.12 1998/11/10 04:09:11 mcooper Exp $"; |
| 632 | |
| 633 | @@ -55,7 +55,7 @@ |
| 634 | extern DISTOPTINFO *getdistopt(name) |
| 635 | char *name; |
| 636 | { |
| 637 | - register int i; |
| 638 | + int i; |
| 639 | |
| 640 | for (i = 0; distoptinfo[i].do_name; ++i) |
| 641 | if (strcasecmp(name, distoptinfo[i].do_name) == 0) |
| 642 | @@ -74,7 +74,7 @@ |
| 643 | opt_t *optptr; |
| 644 | int doerrs; |
| 645 | { |
| 646 | - register char *string, *optstr; |
| 647 | + char *string, *optstr; |
| 648 | DISTOPTINFO *distopt; |
| 649 | int negate; |
| 650 | |
| 651 | @@ -93,7 +93,7 @@ |
| 652 | * and the option starts with "no", strip "no" |
| 653 | * from option and retry lookup. |
| 654 | */ |
| 655 | - if (distopt = getdistopt(optstr)) { |
| 656 | + if ((distopt = getdistopt(optstr))) { |
| 657 | FLAG_ON(*optptr, distopt->do_value); |
| 658 | continue; |
| 659 | } |
| 660 | @@ -116,7 +116,7 @@ |
| 661 | */ |
| 662 | extern char *getdistoptlist() |
| 663 | { |
| 664 | - register int i; |
| 665 | + int i; |
| 666 | static char buf[1024]; |
| 667 | |
| 668 | for (i = 0, buf[0] = CNULL; distoptinfo[i].do_name; ++i) { |
| 669 | @@ -138,7 +138,7 @@ |
| 670 | extern char *getondistoptlist(opts) |
| 671 | opt_t opts; |
| 672 | { |
| 673 | - register int i; |
| 674 | + int i; |
| 675 | static char buf[1024]; |
| 676 | |
| 677 | for (i = 0, buf[0] = CNULL; distoptinfo[i].do_name; ++i) { |
| 678 | --- rdist-6.1.5/src/expand.c.cleanup 1998-11-10 05:09:31.000000000 +0100 |
| 679 | +++ rdist-6.1.5/src/expand.c 2003-12-17 11:38:16.000000000 +0100 |
| 680 | @@ -38,7 +38,7 @@ |
| 681 | * SUCH DAMAGE. |
| 682 | */ |
| 683 | |
| 684 | -#ifndef lint |
| 685 | +#if 0 |
| 686 | static char RCSid[] = |
| 687 | "$Id: expand.c,v 6.19 1998/11/10 04:09:31 mcooper Exp $"; |
| 688 | |
| 689 | @@ -81,9 +81,9 @@ |
| 690 | sizeof(*sortbase), argcmp), sortbase = &eargv[eargc] |
| 691 | |
| 692 | static void Cat(s1, s2) /* quote in s1 and s2 */ |
| 693 | - register u_char *s1, *s2; |
| 694 | + u_char *s1, *s2; |
| 695 | { |
| 696 | - register char *cp; |
| 697 | + char *cp; |
| 698 | int len = strlen((char *)s1) + strlen((char *)s2) + 2; |
| 699 | |
| 700 | if ((eargc + 1) >= MAXEARGS) { |
| 701 | @@ -97,12 +97,12 @@ |
| 702 | do { |
| 703 | if (*s1 == QUOTECHAR) |
| 704 | s1++; |
| 705 | - } while (*cp++ = *s1++); |
| 706 | + } while ((*cp++ = *s1++)); |
| 707 | cp--; |
| 708 | do { |
| 709 | if (*s2 == QUOTECHAR) |
| 710 | s2++; |
| 711 | - } while (*cp++ = *s2++); |
| 712 | + } while ((*cp++ = *s2++)); |
| 713 | } |
| 714 | |
| 715 | static void addpath(c) |
| 716 | @@ -131,8 +131,8 @@ |
| 717 | struct namelist *list; |
| 718 | int wh; |
| 719 | { |
| 720 | - register struct namelist *nl, *prev; |
| 721 | - register int n; |
| 722 | + struct namelist *nl, *prev; |
| 723 | + int n; |
| 724 | char pathbuf[BUFSIZ]; |
| 725 | |
| 726 | if (debug) |
| 727 | @@ -182,7 +182,7 @@ |
| 728 | u_char *str; |
| 729 | int ch; |
| 730 | { |
| 731 | - register u_char *cp; |
| 732 | + u_char *cp; |
| 733 | |
| 734 | for (cp = str; cp && *cp != CNULL; ++cp) |
| 735 | if (ch == *cp) |
| 736 | @@ -194,8 +194,8 @@ |
| 737 | void expstr(s) |
| 738 | u_char *s; |
| 739 | { |
| 740 | - register u_char *cp, *cp1; |
| 741 | - register struct namelist *tp; |
| 742 | + u_char *cp, *cp1; |
| 743 | + struct namelist *tp; |
| 744 | u_char *tail; |
| 745 | u_char ebuf[BUFSIZ]; |
| 746 | u_char varbuff[BUFSIZ]; |
| 747 | @@ -302,7 +302,7 @@ |
| 748 | cp1 = (u_char *)pw->pw_dir; |
| 749 | s = cp; |
| 750 | } |
| 751 | - for (cp = (u_char *)path; *cp++ = *cp1++; ) |
| 752 | + for (cp = (u_char *)path; (*cp++ = *cp1++); ) |
| 753 | ; |
| 754 | tpathp = pathp = (char *)cp - 1; |
| 755 | } else { |
| 756 | @@ -326,7 +326,7 @@ |
| 757 | sort(); |
| 758 | } |
| 759 | |
| 760 | -static |
| 761 | +static int |
| 762 | argcmp(a1, a2) |
| 763 | char **a1, **a2; |
| 764 | { |
| 765 | @@ -341,8 +341,8 @@ |
| 766 | void expsh(s) /* quote in s */ |
| 767 | u_char *s; |
| 768 | { |
| 769 | - register u_char *cp, *oldcp; |
| 770 | - register char *spathp; |
| 771 | + u_char *cp, *oldcp; |
| 772 | + char *spathp; |
| 773 | struct stat stb; |
| 774 | |
| 775 | spathp = pathp; |
| 776 | @@ -380,7 +380,7 @@ |
| 777 | char *pattern; |
| 778 | { |
| 779 | struct stat stb; |
| 780 | - register DIRENTRY *dp; |
| 781 | + DIRENTRY *dp; |
| 782 | DIR *dirp; |
| 783 | |
| 784 | dirp = opendir(path); |
| 785 | @@ -417,11 +417,12 @@ |
| 786 | yyerror(path); |
| 787 | } |
| 788 | |
| 789 | +int |
| 790 | execbrc(p, s) /* quote in p */ |
| 791 | u_char *p, *s; |
| 792 | { |
| 793 | u_char restbuf[BUFSIZ + 2]; |
| 794 | - register u_char *pe, *pm, *pl; |
| 795 | + u_char *pe, *pm, *pl; |
| 796 | int brclev = 0; |
| 797 | u_char *lm, savec; |
| 798 | char *spathp; |
| 799 | @@ -507,11 +508,12 @@ |
| 800 | return (0); |
| 801 | } |
| 802 | |
| 803 | +int |
| 804 | match(s, p) /* quote in p */ |
| 805 | char *s, *p; |
| 806 | { |
| 807 | - register int c; |
| 808 | - register char *sentp; |
| 809 | + int c; |
| 810 | + char *sentp; |
| 811 | char sexpany = expany; |
| 812 | |
| 813 | if (*s == '.' && *p != '.') |
| 814 | @@ -524,11 +526,12 @@ |
| 815 | return (c); |
| 816 | } |
| 817 | |
| 818 | +int |
| 819 | amatch(s, p) /* quote in p */ |
| 820 | - register char *s; |
| 821 | - register u_char *p; |
| 822 | + char *s; |
| 823 | + u_char *p; |
| 824 | { |
| 825 | - register int scc; |
| 826 | + int scc; |
| 827 | int ok, lc; |
| 828 | char *spathp; |
| 829 | struct stat stb; |
| 830 | @@ -545,7 +548,7 @@ |
| 831 | case '[': |
| 832 | ok = 0; |
| 833 | lc = 077777; |
| 834 | - while (cc = *p++) { |
| 835 | + while ((cc = *p++)) { |
| 836 | if (cc == ']') { |
| 837 | if (ok) |
| 838 | break; |
| 839 | @@ -599,7 +602,7 @@ |
| 840 | while (*s) |
| 841 | addpath(*s++); |
| 842 | addpath('/'); |
| 843 | - if (stat(path, &stb) == 0 && S_ISDIR(stb.st_mode)) |
| 844 | + if (stat(path, &stb) == 0 && S_ISDIR(stb.st_mode)) { |
| 845 | if (*p == CNULL) { |
| 846 | if (which & E_TILDE) |
| 847 | Cat((u_char *)path, |
| 848 | @@ -609,6 +612,7 @@ |
| 849 | (u_char *)tpathp); |
| 850 | } else |
| 851 | expsh(p); |
| 852 | + } |
| 853 | pathp = spathp; |
| 854 | *pathp = CNULL; |
| 855 | return (0); |
| 856 | --- rdist-6.1.5/src/lookup.c.cleanup 1998-11-10 05:12:56.000000000 +0100 |
| 857 | +++ rdist-6.1.5/src/lookup.c 2003-12-17 11:38:16.000000000 +0100 |
| 858 | @@ -38,7 +38,7 @@ |
| 859 | * SUCH DAMAGE. |
| 860 | */ |
| 861 | |
| 862 | -#ifndef lint |
| 863 | +#if 0 |
| 864 | static char RCSid[] = |
| 865 | "$Id: lookup.c,v 6.9 1998/11/10 04:12:56 mcooper Exp $"; |
| 866 | |
| 867 | @@ -68,11 +68,12 @@ |
| 868 | /* |
| 869 | * Define a variable from a command line argument. |
| 870 | */ |
| 871 | +void |
| 872 | define(name) |
| 873 | char *name; |
| 874 | { |
| 875 | - register char *cp, *s; |
| 876 | - register struct namelist *nl; |
| 877 | + char *cp, *s; |
| 878 | + struct namelist *nl; |
| 879 | struct namelist *value; |
| 880 | |
| 881 | debugmsg(DM_CALL, "define(%s)", name); |
| 882 | @@ -137,9 +138,9 @@ |
| 883 | int action; |
| 884 | struct namelist *value; |
| 885 | { |
| 886 | - register unsigned n; |
| 887 | - register char *cp; |
| 888 | - register struct syment *s; |
| 889 | + unsigned n; |
| 890 | + char *cp; |
| 891 | + struct syment *s; |
| 892 | char ebuf[BUFSIZ]; |
| 893 | |
| 894 | debugmsg(DM_CALL, "lookup(%s, %d, %x)", name, action, value); |
| 895 | --- rdist-6.1.5/src/isexec.c.cleanup 1998-11-10 05:11:42.000000000 +0100 |
| 896 | +++ rdist-6.1.5/src/isexec.c 2003-12-17 11:38:16.000000000 +0100 |
| 897 | @@ -37,7 +37,7 @@ |
| 898 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 899 | * SUCH DAMAGE. |
| 900 | */ |
| 901 | -#ifndef lint |
| 902 | +#if 0 |
| 903 | static char RCSid[] = |
| 904 | "$Id: isexec.c,v 6.22 1998/11/10 04:11:42 mcooper Exp $"; |
| 905 | |
| 906 | --- rdist-6.1.5/src/signal.c.cleanup 1998-11-10 05:16:13.000000000 +0100 |
| 907 | +++ rdist-6.1.5/src/signal.c 2003-12-17 11:38:16.000000000 +0100 |
| 908 | @@ -38,7 +38,7 @@ |
| 909 | * SUCH DAMAGE. |
| 910 | */ |
| 911 | |
| 912 | -#ifndef lint |
| 913 | +#if 0 |
| 914 | static char RCSid[] = |
| 915 | "$Id: signal.c,v 6.2 1998/11/10 04:16:13 mcooper Exp $"; |
| 916 | |
| 917 | --- rdist-6.1.5/src/rshrcmd.c.cleanup 1998-11-10 05:15:07.000000000 +0100 |
| 918 | +++ rdist-6.1.5/src/rshrcmd.c 2003-12-17 11:38:16.000000000 +0100 |
| 919 | @@ -10,7 +10,7 @@ |
| 920 | * Chris Siebenmann <cks@utcc.utoronto.ca>. |
| 921 | */ |
| 922 | |
| 923 | -#ifndef lint |
| 924 | +#if 0 |
| 925 | static char RCSid[] = |
| 926 | "$Id: rshrcmd.c,v 1.9 1998/11/10 04:15:07 mcooper Exp $"; |
| 927 | |
| 928 | @@ -34,6 +34,7 @@ |
| 929 | * program in place of a direct rcmd() function call so as to |
| 930 | * avoid having to be root. |
| 931 | */ |
| 932 | +int |
| 933 | rshrcmd(ahost, port, luser, ruser, cmd, fd2p) |
| 934 | char **ahost; |
| 935 | u_short port; |
| 936 | @@ -108,6 +109,7 @@ |
| 937 | (void) wait(0); |
| 938 | return sp[0]; |
| 939 | } |
| 940 | + return -1; |
| 941 | /*NOTREACHED*/ |
| 942 | } |
| 943 | |
| 944 | --- rdist-6.1.5/src/common.c.cleanup 1998-11-10 05:09:01.000000000 +0100 |
| 945 | +++ rdist-6.1.5/src/common.c 2003-12-17 11:38:16.000000000 +0100 |
| 946 | @@ -38,7 +38,7 @@ |
| 947 | * SUCH DAMAGE. |
| 948 | */ |
| 949 | |
| 950 | -#ifndef lint |
| 951 | +#if 0 |
| 952 | static char RCSid[] = |
| 953 | "$Id: common.c,v 6.84 1998/11/10 04:09:01 mcooper Exp $"; |
| 954 | |
| 955 | @@ -87,14 +87,14 @@ |
| 956 | /* |
| 957 | * Front end to write() that handles partial write() requests. |
| 958 | */ |
| 959 | -extern WRITE_RETURN_T xwrite(fd, buf, len) |
| 960 | +WRITE_RETURN_T xwrite(fd, buf, len) |
| 961 | int fd; |
| 962 | void *buf; |
| 963 | WRITE_AMT_T len; |
| 964 | { |
| 965 | WRITE_AMT_T nleft = len; |
| 966 | WRITE_RETURN_T nwritten; |
| 967 | - register char *ptr = buf; |
| 968 | + char *ptr = buf; |
| 969 | |
| 970 | while (nleft > 0) { |
| 971 | if ((nwritten = write(fd, ptr, nleft)) <= 0) { |
| 972 | @@ -110,14 +110,14 @@ |
| 973 | /* |
| 974 | * Set program name |
| 975 | */ |
| 976 | -extern void setprogname(argv) |
| 977 | +void setprogname(argv) |
| 978 | char **argv; |
| 979 | { |
| 980 | - register char *cp; |
| 981 | + char *cp; |
| 982 | |
| 983 | if (!progname) { |
| 984 | progname = strdup(argv[0]); |
| 985 | - if (cp = strrchr(progname, '/')) |
| 986 | + if ((cp = strrchr(progname, '/'))) |
| 987 | progname = cp + 1; |
| 988 | } |
| 989 | } |
| 990 | @@ -125,14 +125,14 @@ |
| 991 | /* |
| 992 | * Do run-time initialization |
| 993 | */ |
| 994 | -extern int init(argc, argv, envp) |
| 995 | +int init(argc, argv, envp) |
| 996 | /*ARGSUSED*/ |
| 997 | int argc; |
| 998 | char **argv; |
| 999 | char **envp; |
| 1000 | { |
| 1001 | - register int i; |
| 1002 | - register char *cp; |
| 1003 | + int i; |
| 1004 | + char *cp; |
| 1005 | |
| 1006 | if (!isserver) |
| 1007 | (void) signal(SIGSEGV, sighandler); |
| 1008 | @@ -182,7 +182,7 @@ |
| 1009 | /* |
| 1010 | * Finish things up before ending. |
| 1011 | */ |
| 1012 | -extern void finish() |
| 1013 | +void finish() |
| 1014 | { |
| 1015 | extern jmp_buf finish_jmpbuf; |
| 1016 | |
| 1017 | @@ -216,7 +216,7 @@ |
| 1018 | /* |
| 1019 | * Handle lost connections |
| 1020 | */ |
| 1021 | -extern void lostconn() |
| 1022 | +void lostconn() |
| 1023 | { |
| 1024 | /* Prevent looping */ |
| 1025 | (void) signal(SIGPIPE, SIG_IGN); |
| 1026 | @@ -232,7 +232,7 @@ |
| 1027 | /* |
| 1028 | * Do a core dump |
| 1029 | */ |
| 1030 | -extern void coredump() |
| 1031 | +void coredump() |
| 1032 | { |
| 1033 | error("Segmentation violation - dumping core [PID = %d, %s]", |
| 1034 | getpid(), |
| 1035 | @@ -245,7 +245,7 @@ |
| 1036 | /* |
| 1037 | * General signal handler |
| 1038 | */ |
| 1039 | -extern void sighandler(sig) |
| 1040 | +void sighandler(sig) |
| 1041 | int sig; |
| 1042 | { |
| 1043 | debugmsg(DM_CALL, "sighandler() received signal %d\n", sig); |
| 1044 | @@ -325,7 +325,7 @@ |
| 1045 | /* |
| 1046 | * Stdarg frontend to sendcmdmsg() |
| 1047 | */ |
| 1048 | -extern int sendcmd(char cmd, char *fmt, ...) |
| 1049 | +int sendcmd(char cmd, char *fmt, ...) |
| 1050 | { |
| 1051 | static char buf[BUFSIZ]; |
| 1052 | va_list args; |
| 1053 | @@ -345,7 +345,7 @@ |
| 1054 | /* |
| 1055 | * Varargs frontend to sendcmdmsg() |
| 1056 | */ |
| 1057 | -extern int sendcmd(va_alist) |
| 1058 | +int sendcmd(va_alist) |
| 1059 | va_dcl |
| 1060 | { |
| 1061 | static char buf[BUFSIZ]; |
| 1062 | @@ -372,7 +372,7 @@ |
| 1063 | * Stupid frontend to sendcmdmsg() |
| 1064 | */ |
| 1065 | /*VARARGS2*/ |
| 1066 | -extern int sendcmd(cmd, fmt, a1, a2, a3, a4, a5, a6, a7, a8) |
| 1067 | +int sendcmd(cmd, fmt, a1, a2, a3, a4, a5, a6, a7, a8) |
| 1068 | char cmd; |
| 1069 | char *fmt; |
| 1070 | { |
| 1071 | @@ -433,13 +433,13 @@ |
| 1072 | * errors, call cleanup() or lostconn(). In other words, unless |
| 1073 | * the third argument is nonzero, this routine never returns failure. |
| 1074 | */ |
| 1075 | -extern int remline(buffer, space, doclean) |
| 1076 | - register u_char *buffer; |
| 1077 | +int remline(buffer, space, doclean) |
| 1078 | + u_char *buffer; |
| 1079 | int space; |
| 1080 | int doclean; |
| 1081 | { |
| 1082 | - register int c, left = space; |
| 1083 | - register u_char *p = buffer; |
| 1084 | + int c, left = space; |
| 1085 | + u_char *p = buffer; |
| 1086 | |
| 1087 | if (rem_r < 0) { |
| 1088 | error("Cannot read remote input: Remote descriptor not open."); |
| 1089 | @@ -494,9 +494,9 @@ |
| 1090 | /* |
| 1091 | * Non-line-oriented remote read. |
| 1092 | */ |
| 1093 | -readrem(p, space) |
| 1094 | +int readrem(p, space) |
| 1095 | char *p; |
| 1096 | - register int space; |
| 1097 | + int space; |
| 1098 | { |
| 1099 | if (remleft <= 0) { |
| 1100 | /* |
| 1101 | @@ -527,7 +527,7 @@ |
| 1102 | /* |
| 1103 | * Get the user name for the uid. |
| 1104 | */ |
| 1105 | -extern char *getusername(uid, file, opts) |
| 1106 | +char *getusername(uid, file, opts) |
| 1107 | UID_T uid; |
| 1108 | char *file; |
| 1109 | opt_t opts; |
| 1110 | @@ -566,7 +566,7 @@ |
| 1111 | /* |
| 1112 | * Get the group name for the gid. |
| 1113 | */ |
| 1114 | -extern char *getgroupname(gid, file, opts) |
| 1115 | +char *getgroupname(gid, file, opts) |
| 1116 | GID_T gid; |
| 1117 | char *file; |
| 1118 | opt_t opts; |
| 1119 | @@ -604,7 +604,7 @@ |
| 1120 | /* |
| 1121 | * Read a response from the remote host. |
| 1122 | */ |
| 1123 | -extern int response() |
| 1124 | +int response() |
| 1125 | { |
| 1126 | static u_char resp[BUFSIZ]; |
| 1127 | u_char *s; |
| 1128 | @@ -646,6 +646,7 @@ |
| 1129 | message(MT_FERROR, "%s", s); |
| 1130 | finish(); |
| 1131 | } |
| 1132 | + return -1; |
| 1133 | /*NOTREACHED*/ |
| 1134 | } |
| 1135 | |
| 1136 | @@ -657,11 +658,11 @@ |
| 1137 | * user's home directory path name. Return a pointer in buf to the |
| 1138 | * part corresponding to `file'. |
| 1139 | */ |
| 1140 | -extern char *exptilde(ebuf, file) |
| 1141 | +char *exptilde(ebuf, file) |
| 1142 | char *ebuf; |
| 1143 | - register char *file; |
| 1144 | + char *file; |
| 1145 | { |
| 1146 | - register char *s1, *s2, *s3; |
| 1147 | + char *s1, *s2, *s3; |
| 1148 | extern char *homedir; |
| 1149 | |
| 1150 | if (*file != '~') { |
| 1151 | @@ -694,12 +695,12 @@ |
| 1152 | *s3 = '/'; |
| 1153 | s2 = pw->pw_dir; |
| 1154 | } |
| 1155 | - for (s1 = ebuf; *s1++ = *s2++; ) |
| 1156 | + for (s1 = ebuf; (*s1++ = *s2++); ) |
| 1157 | ; |
| 1158 | s2 = --s1; |
| 1159 | if (s3 != NULL) { |
| 1160 | s2++; |
| 1161 | - while (*s1++ = *s3++) |
| 1162 | + while ((*s1++ = *s3++)) |
| 1163 | ; |
| 1164 | } |
| 1165 | return(s2); |
| 1166 | @@ -710,7 +711,7 @@ |
| 1167 | * Set our effective user id to the user running us. |
| 1168 | * This should be the uid we do most of our work as. |
| 1169 | */ |
| 1170 | -extern int becomeuser() |
| 1171 | +int becomeuser() |
| 1172 | { |
| 1173 | int r = 0; |
| 1174 | |
| 1175 | @@ -732,7 +733,7 @@ |
| 1176 | /* |
| 1177 | * Set our effective user id to "root" (uid = 0) |
| 1178 | */ |
| 1179 | -extern int becomeroot() |
| 1180 | +int becomeroot() |
| 1181 | { |
| 1182 | int r = 0; |
| 1183 | |
| 1184 | @@ -753,7 +754,7 @@ |
| 1185 | /* |
| 1186 | * Set access and modify times of a given file |
| 1187 | */ |
| 1188 | -extern int setfiletime(file, atime, mtime) |
| 1189 | +int setfiletime(file, atime, mtime) |
| 1190 | char *file; |
| 1191 | time_t atime; |
| 1192 | time_t mtime; |
| 1193 | @@ -790,7 +791,7 @@ |
| 1194 | /* |
| 1195 | * Get version info |
| 1196 | */ |
| 1197 | -extern char *getversion() |
| 1198 | +char *getversion() |
| 1199 | { |
| 1200 | static char buff[BUFSIZ]; |
| 1201 | |
| 1202 | @@ -811,7 +812,7 @@ |
| 1203 | { |
| 1204 | int fd[2], pid, i; |
| 1205 | int status; |
| 1206 | - register char *cp, *s; |
| 1207 | + char *cp, *s; |
| 1208 | char sbuf[BUFSIZ], buf[BUFSIZ]; |
| 1209 | |
| 1210 | if (pipe(fd) < 0) { |
| 1211 | @@ -933,12 +934,12 @@ |
| 1212 | /* |
| 1213 | * Private version of basename() |
| 1214 | */ |
| 1215 | -extern char *xbasename(path) |
| 1216 | +char *xbasename(path) |
| 1217 | char *path; |
| 1218 | { |
| 1219 | - register char *cp; |
| 1220 | + char *cp; |
| 1221 | |
| 1222 | - if (cp = strrchr(path, '/')) |
| 1223 | + if ((cp = strrchr(path, '/'))) |
| 1224 | return(cp+1); |
| 1225 | else |
| 1226 | return(path); |
| 1227 | @@ -949,11 +950,11 @@ |
| 1228 | * search until a component of that path is found and |
| 1229 | * return the found file name. |
| 1230 | */ |
| 1231 | -extern char *searchpath(path) |
| 1232 | +char *searchpath(path) |
| 1233 | char *path; |
| 1234 | { |
| 1235 | - register char *cp; |
| 1236 | - register char *file; |
| 1237 | + char *cp; |
| 1238 | + char *file; |
| 1239 | struct stat statbuf; |
| 1240 | |
| 1241 | for (; ;) { |
| 1242 | @@ -977,8 +978,7 @@ |
| 1243 | /* |
| 1244 | * Set line buffering. |
| 1245 | */ |
| 1246 | -extern void |
| 1247 | -mysetlinebuf(fp) |
| 1248 | +void mysetlinebuf(fp) |
| 1249 | FILE *fp; |
| 1250 | { |
| 1251 | #if SETBUF_TYPE == SETBUF_SETLINEBUF |
| 1252 | @@ -995,8 +995,7 @@ |
| 1253 | /* |
| 1254 | * Our interface to system call to get a socket pair. |
| 1255 | */ |
| 1256 | -int |
| 1257 | -getsocketpair(domain, type, protocol, sv) |
| 1258 | +int getsocketpair(domain, type, protocol, sv) |
| 1259 | int domain; |
| 1260 | int type; |
| 1261 | int protocol; |
| 1262 | --- rdist-6.1.5/src/message.c.cleanup 1998-11-10 05:13:30.000000000 +0100 |
| 1263 | +++ rdist-6.1.5/src/message.c 2003-12-17 11:38:16.000000000 +0100 |
| 1264 | @@ -38,7 +38,7 @@ |
| 1265 | * SUCH DAMAGE. |
| 1266 | */ |
| 1267 | |
| 1268 | -#ifndef lint |
| 1269 | +#if 0 |
| 1270 | static char RCSid[] = |
| 1271 | "$Id: message.c,v 6.25 1998/11/10 04:13:30 mcooper Exp $"; |
| 1272 | |
| 1273 | @@ -97,7 +97,7 @@ |
| 1274 | */ |
| 1275 | extern void msgprusage() |
| 1276 | { |
| 1277 | - register int i, x; |
| 1278 | + int i, x; |
| 1279 | |
| 1280 | (void) fprintf(stderr, "\nWhere <msgopt> is of form\n"); |
| 1281 | (void) fprintf(stderr, |
| 1282 | @@ -120,7 +120,7 @@ |
| 1283 | */ |
| 1284 | extern void msgprconfig() |
| 1285 | { |
| 1286 | - register int i, x; |
| 1287 | + int i, x; |
| 1288 | static char buf[MSGBUFSIZ]; |
| 1289 | |
| 1290 | debugmsg(DM_MISC, "Current message logging config:"); |
| 1291 | @@ -145,7 +145,7 @@ |
| 1292 | static MSGFACILITY *getmsgfac(name) |
| 1293 | char *name; |
| 1294 | { |
| 1295 | - register int i; |
| 1296 | + int i; |
| 1297 | |
| 1298 | for (i = 0; msgfacility[i].mf_name; ++i) |
| 1299 | if (strcasecmp(name, msgfacility[i].mf_name) == 0) |
| 1300 | @@ -160,7 +160,7 @@ |
| 1301 | static MSGTYPE *getmsgtype(name) |
| 1302 | char *name; |
| 1303 | { |
| 1304 | - register int i; |
| 1305 | + int i; |
| 1306 | |
| 1307 | for (i = 0; msgtypes[i].mt_name; ++i) |
| 1308 | if (strcasecmp(name, msgtypes[i].mt_name) == 0) |
| 1309 | @@ -178,9 +178,9 @@ |
| 1310 | char *str; |
| 1311 | { |
| 1312 | static char ebuf[BUFSIZ]; |
| 1313 | - register char *cp; |
| 1314 | - register char *strptr, *word; |
| 1315 | - register MSGTYPE *mtp; |
| 1316 | + char *cp; |
| 1317 | + char *strptr, *word; |
| 1318 | + MSGTYPE *mtp; |
| 1319 | |
| 1320 | /* |
| 1321 | * MF_SYSLOG is the only supported message facility for the server |
| 1322 | @@ -240,11 +240,11 @@ |
| 1323 | msgfac->mf_msgtypes = 0; /* Start from scratch */ |
| 1324 | while (strptr) { |
| 1325 | word = strptr; |
| 1326 | - if (cp = strchr(strptr, ',')) |
| 1327 | + if ((cp = strchr(strptr, ','))) |
| 1328 | *cp++ = CNULL; |
| 1329 | strptr = cp; |
| 1330 | |
| 1331 | - if (mtp = getmsgtype(word)) { |
| 1332 | + if ((mtp = getmsgtype(word))) { |
| 1333 | msgfac->mf_msgtypes |= mtp->mt_type; |
| 1334 | /* |
| 1335 | * XXX This is really a kludge until we add real |
| 1336 | @@ -272,8 +272,8 @@ |
| 1337 | int doset; |
| 1338 | { |
| 1339 | static char ebuf[BUFSIZ], msgbuf[MSGBUFSIZ]; |
| 1340 | - register char *cp, *optstr; |
| 1341 | - register char *word; |
| 1342 | + char *cp, *optstr; |
| 1343 | + char *word; |
| 1344 | MSGFACILITY *msgfac; |
| 1345 | |
| 1346 | if (msgstr == NULL) |
| 1347 | @@ -308,7 +308,7 @@ |
| 1348 | if (doset) { |
| 1349 | char *mcp; |
| 1350 | |
| 1351 | - if (mcp = setmsgtypes(msgfac, cp)) |
| 1352 | + if ((mcp = setmsgtypes(msgfac, cp))) |
| 1353 | return(mcp); |
| 1354 | } |
| 1355 | } |
| 1356 | @@ -462,8 +462,9 @@ |
| 1357 | return; |
| 1358 | |
| 1359 | if (!msgfac->mf_fptr) { |
| 1360 | - register char *cp; |
| 1361 | + char *cp; |
| 1362 | char *getenv(); |
| 1363 | + int fd; |
| 1364 | |
| 1365 | /* |
| 1366 | * Create and open a new temporary file |
| 1367 | @@ -475,7 +476,10 @@ |
| 1368 | (void) sprintf(tempfile, "%s/%s", cp, _RDIST_TMP); |
| 1369 | |
| 1370 | msgfac->mf_filename = tempfile; |
| 1371 | - (void) mktemp(msgfac->mf_filename); |
| 1372 | + fd = mkstemp(msgfac->mf_filename); |
| 1373 | + if (fd < 0) |
| 1374 | + fatalerr("Cannot open notify file for writing: %s: %s.", msgfac->mf_filename, SYSERR); |
| 1375 | + close(fd); |
| 1376 | if ((msgfac->mf_fptr = fopen(msgfac->mf_filename, "w"))==NULL) |
| 1377 | fatalerr("Cannot open notify file for writing: %s: %s.", |
| 1378 | msgfac->mf_filename, SYSERR); |
| 1379 | @@ -515,15 +519,15 @@ |
| 1380 | int flags; |
| 1381 | char *msgbuf; |
| 1382 | { |
| 1383 | - register int i, x; |
| 1384 | - register char *cp; |
| 1385 | + int i, x; |
| 1386 | + char *cp; |
| 1387 | static char mbuf[2048]; |
| 1388 | |
| 1389 | if (msgbuf && *msgbuf) { |
| 1390 | /* |
| 1391 | * Ensure no stray newlines are present |
| 1392 | */ |
| 1393 | - if (cp = strchr(msgbuf, '\n')) |
| 1394 | + if ((cp = strchr(msgbuf, '\n'))) |
| 1395 | *cp = CNULL; |
| 1396 | |
| 1397 | checkhostname(); |
| 1398 | @@ -863,7 +867,7 @@ |
| 1399 | */ |
| 1400 | extern char *getnotifyfile() |
| 1401 | { |
| 1402 | - register int i; |
| 1403 | + int i; |
| 1404 | |
| 1405 | for (i = 0; msgfacility[i].mf_name; i++) |
| 1406 | if (msgfacility[i].mf_msgfac == MF_NOTIFY && |
| 1407 | --- rdist-6.1.5/src/setargs.c.cleanup 2003-12-17 11:38:16.000000000 +0100 |
| 1408 | +++ rdist-6.1.5/src/setargs.c 2003-12-17 11:38:16.000000000 +0100 |
| 1409 | @@ -38,7 +38,7 @@ |
| 1410 | * SUCH DAMAGE. |
| 1411 | */ |
| 1412 | |
| 1413 | -#ifndef lint |
| 1414 | +#if 0 |
| 1415 | static char RCSid[] = |
| 1416 | "$Id: setargs.c,v 6.5 1998/11/10 04:15:56 mcooper Exp $"; |
| 1417 | |
| 1418 | @@ -66,12 +66,12 @@ |
| 1419 | /* |
| 1420 | * Settup things for using setproctitle() |
| 1421 | */ |
| 1422 | -setargs_settup(argc, argv, envp) |
| 1423 | +void setargs_settup(argc, argv, envp) |
| 1424 | int argc; |
| 1425 | char **argv; |
| 1426 | char **envp; |
| 1427 | { |
| 1428 | - register int i; |
| 1429 | + int i; |
| 1430 | extern char **environ; |
| 1431 | |
| 1432 | /* Remember the User Environment */ |
| 1433 | @@ -92,10 +92,10 @@ |
| 1434 | /* |
| 1435 | * Set process title |
| 1436 | */ |
| 1437 | -extern void _setproctitle(msg) |
| 1438 | +void _setproctitle(msg) |
| 1439 | char *msg; |
| 1440 | { |
| 1441 | - register int i; |
| 1442 | + int i; |
| 1443 | char *p; |
| 1444 | |
| 1445 | p = Argv[0]; |
| 1446 | @@ -119,7 +119,7 @@ |
| 1447 | /* |
| 1448 | * Varargs front-end to _setproctitle() |
| 1449 | */ |
| 1450 | -extern void setproctitle(va_alist) |
| 1451 | +void setproctitle(va_alist) |
| 1452 | va_dcl |
| 1453 | { |
| 1454 | static char buf[BUFSIZ]; |
| 1455 | @@ -138,7 +138,7 @@ |
| 1456 | /* |
| 1457 | * Stdarg front-end to _setproctitle() |
| 1458 | */ |
| 1459 | -extern void setproctitle(char *fmt, ...) |
| 1460 | +void setproctitle(char *fmt, ...) |
| 1461 | { |
| 1462 | static char buf[BUFSIZ]; |
| 1463 | va_list args; |
| 1464 | @@ -155,7 +155,7 @@ |
| 1465 | * Non-Varargs front-end to _setproctitle() |
| 1466 | */ |
| 1467 | /*VARARGS1*/ |
| 1468 | -extern void setproctitle(fmt, a1, a2, a3, a4, a5, a6) |
| 1469 | +void setproctitle(fmt, a1, a2, a3, a4, a5, a6) |
| 1470 | char *fmt; |
| 1471 | { |
| 1472 | static char buf[BUFSIZ]; |
| 1473 | --- rdist-6.1.5/src/rdistd.c.cleanup 1998-11-10 05:14:06.000000000 +0100 |
| 1474 | +++ rdist-6.1.5/src/rdistd.c 2003-12-17 11:38:16.000000000 +0100 |
| 1475 | @@ -38,7 +38,7 @@ |
| 1476 | * SUCH DAMAGE. |
| 1477 | */ |
| 1478 | |
| 1479 | -#ifndef lint |
| 1480 | +#if 0 |
| 1481 | static char RCSid[] = |
| 1482 | "$Id: rdistd.c,v 6.23 1998/11/10 04:14:06 mcooper Exp $"; |
| 1483 | |
| 1484 | @@ -53,21 +53,12 @@ |
| 1485 | |
| 1486 | #include "defs.h" |
| 1487 | |
| 1488 | -/* |
| 1489 | - * Print usage message |
| 1490 | - */ |
| 1491 | -static void usage() |
| 1492 | -{ |
| 1493 | - fprintf(stderr, "usage: %s -S [ -DV ]\n", progname); |
| 1494 | - exit(1); |
| 1495 | -} |
| 1496 | - |
| 1497 | char localmsglist[] = "syslog=ferror"; |
| 1498 | |
| 1499 | /* |
| 1500 | * The Beginning |
| 1501 | */ |
| 1502 | -main(argc, argv, envp) |
| 1503 | +int main(argc, argv, envp) |
| 1504 | int argc; |
| 1505 | char **argv; |
| 1506 | char **envp; |
| 1507 | @@ -95,7 +86,8 @@ |
| 1508 | case '?': |
| 1509 | default: |
| 1510 | error("Bad command line option."); |
| 1511 | - usage(); |
| 1512 | + fprintf(stderr, "usage: %s -S [ -DV ]\n", progname); |
| 1513 | + exit(1); |
| 1514 | } |
| 1515 | |
| 1516 | if (!isserver) { |
| 1517 | @@ -108,7 +100,7 @@ |
| 1518 | rem_w = fileno(stdout); |
| 1519 | |
| 1520 | /* Set logging */ |
| 1521 | - if (cp = msgparseopts(localmsglist, TRUE)) |
| 1522 | + if ((cp = msgparseopts(localmsglist, TRUE))) |
| 1523 | fatalerr("Bad message logging option (%s): %s", |
| 1524 | localmsglist, cp); |
| 1525 | |
| 1526 | --- rdist-6.1.5/src/server.c.cleanup 2003-12-17 11:38:16.000000000 +0100 |
| 1527 | +++ rdist-6.1.5/src/server.c 2003-12-17 11:38:16.000000000 +0100 |
| 1528 | @@ -37,7 +37,7 @@ |
| 1529 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 1530 | * SUCH DAMAGE. |
| 1531 | */ |
| 1532 | -#ifndef lint |
| 1533 | +#if 0 |
| 1534 | static char RCSid[] = |
| 1535 | "$Id: server.c,v 6.86 1998/11/10 04:15:31 mcooper Exp $"; |
| 1536 | |
| 1537 | @@ -197,7 +197,7 @@ |
| 1538 | static UID_T last_uid = (UID_T)-2; |
| 1539 | static GID_T last_primegid; |
| 1540 | extern char *locuser; |
| 1541 | - register int i; |
| 1542 | + int i; |
| 1543 | UID_T uid; |
| 1544 | GID_T gid; |
| 1545 | GID_T primegid = (GID_T)-2; |
| 1546 | @@ -252,7 +252,7 @@ |
| 1547 | /* |
| 1548 | * Invalid cached values so we need to do a new lookup. |
| 1549 | */ |
| 1550 | - if (gr = mygetgroup(group)) { |
| 1551 | + if ((gr = mygetgroup(group))) { |
| 1552 | last_gid = gid = gr->gr_gid; |
| 1553 | strcpy(last_group, gr->gr_name); |
| 1554 | } else { |
| 1555 | @@ -325,7 +325,7 @@ |
| 1556 | { |
| 1557 | DIR *d; |
| 1558 | static DIRENTRY *dp; |
| 1559 | - register char *cp; |
| 1560 | + char *cp; |
| 1561 | struct stat stb; |
| 1562 | char *optarget; |
| 1563 | int len, failures = 0; |
| 1564 | @@ -362,7 +362,7 @@ |
| 1565 | |
| 1566 | optarget = ptarget; |
| 1567 | len = ptarget - target; |
| 1568 | - while (dp = readdir(d)) { |
| 1569 | + while ((dp = readdir(d))) { |
| 1570 | if ((D_NAMLEN(dp) == 1 && dp->d_name[0] == '.') || |
| 1571 | (D_NAMLEN(dp) == 2 && dp->d_name[0] == '.' && |
| 1572 | dp->d_name[1] == '.')) |
| 1573 | @@ -376,7 +376,7 @@ |
| 1574 | ptarget = optarget; |
| 1575 | *ptarget++ = '/'; |
| 1576 | cp = dp->d_name;; |
| 1577 | - while (*ptarget++ = *cp++) |
| 1578 | + while ((*ptarget++ = *cp++)) |
| 1579 | ; |
| 1580 | ptarget--; |
| 1581 | if (lstat(target, &stb) < 0) { |
| 1582 | @@ -414,10 +414,10 @@ |
| 1583 | * for extraneous files and remove them. |
| 1584 | */ |
| 1585 | static void doclean(cp) |
| 1586 | - register char *cp; |
| 1587 | + char *cp; |
| 1588 | { |
| 1589 | DIR *d; |
| 1590 | - register DIRENTRY *dp; |
| 1591 | + DIRENTRY *dp; |
| 1592 | struct stat stb; |
| 1593 | char *optarget, *ep; |
| 1594 | int len; |
| 1595 | @@ -436,7 +436,7 @@ |
| 1596 | |
| 1597 | optarget = ptarget; |
| 1598 | len = ptarget - target; |
| 1599 | - while (dp = readdir(d)) { |
| 1600 | + while ((dp = readdir(d))) { |
| 1601 | if ((D_NAMLEN(dp) == 1 && dp->d_name[0] == '.') || |
| 1602 | (D_NAMLEN(dp) == 2 && dp->d_name[0] == '.' && |
| 1603 | dp->d_name[1] == '.')) |
| 1604 | @@ -450,7 +450,7 @@ |
| 1605 | ptarget = optarget; |
| 1606 | *ptarget++ = '/'; |
| 1607 | cp = dp->d_name;; |
| 1608 | - while (*ptarget++ = *cp++) |
| 1609 | + while ((*ptarget++ = *cp++)) |
| 1610 | ; |
| 1611 | ptarget--; |
| 1612 | if (lstat(target, &stb) < 0) { |
| 1613 | @@ -481,7 +481,7 @@ |
| 1614 | * Frontend to doclean(). |
| 1615 | */ |
| 1616 | static void clean(cp) |
| 1617 | - register char *cp; |
| 1618 | + char *cp; |
| 1619 | { |
| 1620 | doclean(cp); |
| 1621 | (void) sendcmd(CC_END, NULL); |
| 1622 | @@ -509,7 +509,7 @@ |
| 1623 | */ |
| 1624 | static void docmdspecial() |
| 1625 | { |
| 1626 | - register char *cp; |
| 1627 | + char *cp; |
| 1628 | char *cmd, *env = NULL; |
| 1629 | int n; |
| 1630 | int len; |
| 1631 | @@ -667,7 +667,7 @@ |
| 1632 | char *name; |
| 1633 | opt_t opts; |
| 1634 | { |
| 1635 | - register char *cp; |
| 1636 | + char *cp; |
| 1637 | struct stat stb; |
| 1638 | int r = -1; |
| 1639 | |
| 1640 | @@ -760,7 +760,7 @@ |
| 1641 | { |
| 1642 | int f, wrerr, olderrno, lastwashole = 0, wassparse = 0; |
| 1643 | off_t i; |
| 1644 | - register char *cp; |
| 1645 | + char *cp; |
| 1646 | char *savefile = NULL; |
| 1647 | static struct stat statbuff; |
| 1648 | |
| 1649 | @@ -987,7 +987,7 @@ |
| 1650 | char *owner, *group; |
| 1651 | { |
| 1652 | static char lowner[100], lgroup[100]; |
| 1653 | - register char *cp; |
| 1654 | + char *cp; |
| 1655 | struct stat stb; |
| 1656 | int s; |
| 1657 | |
| 1658 | @@ -1044,7 +1044,7 @@ |
| 1659 | |
| 1660 | o = (owner[0] == ':') ? opts & DO_NUMCHKOWNER : |
| 1661 | opts; |
| 1662 | - if (cp = getusername(stb.st_uid, target, o)) |
| 1663 | + if ((cp = getusername(stb.st_uid, target, o))) |
| 1664 | if (strcmp(owner, cp)) |
| 1665 | (void) strcpy(lowner, cp); |
| 1666 | } |
| 1667 | @@ -1053,7 +1053,7 @@ |
| 1668 | |
| 1669 | o = (group[0] == ':') ? opts & DO_NUMCHKGROUP : |
| 1670 | opts; |
| 1671 | - if (cp = getgroupname(stb.st_gid, target, o)) |
| 1672 | + if ((cp = getgroupname(stb.st_gid, target, o))) |
| 1673 | if (strcmp(group, cp)) |
| 1674 | (void) strcpy(lgroup, cp); |
| 1675 | } |
| 1676 | @@ -1107,8 +1107,8 @@ |
| 1677 | if (s < 0) { |
| 1678 | if (errno == ENOENT) { |
| 1679 | if (mkdir(target, mode) == 0 || |
| 1680 | - chkparent(target, opts) == 0 && |
| 1681 | - mkdir(target, mode) == 0) { |
| 1682 | + (chkparent(target, opts) == 0 && |
| 1683 | + mkdir(target, mode) == 0)) { |
| 1684 | message(MT_NOTICE, "%s: mkdir", target); |
| 1685 | (void) fchog(-1, target, owner, group, mode); |
| 1686 | ack(); |
| 1687 | @@ -1304,7 +1304,7 @@ |
| 1688 | static void setconfig(cmd) |
| 1689 | char *cmd; |
| 1690 | { |
| 1691 | - register char *cp = cmd; |
| 1692 | + char *cp = cmd; |
| 1693 | char *estr; |
| 1694 | |
| 1695 | switch (*cp++) { |
| 1696 | @@ -1338,7 +1338,7 @@ |
| 1697 | break; |
| 1698 | |
| 1699 | case SC_LOGGING: /* Logging options */ |
| 1700 | - if (estr = msgparseopts(cp, TRUE)) { |
| 1701 | + if ((estr = msgparseopts(cp, TRUE))) { |
| 1702 | fatalerr("Bad message option string (%s): %s", |
| 1703 | cp, estr); |
| 1704 | return; |
| 1705 | @@ -1455,7 +1455,7 @@ |
| 1706 | sptarget[catname] = ptarget; |
| 1707 | if (catname++) { |
| 1708 | *ptarget++ = '/'; |
| 1709 | - while (*ptarget++ = *file++) |
| 1710 | + while ((*ptarget++ = *file++)) |
| 1711 | ; |
| 1712 | ptarget--; |
| 1713 | } |
| 1714 | @@ -1463,6 +1463,7 @@ |
| 1715 | /* |
| 1716 | * Create name of temporary file |
| 1717 | */ |
| 1718 | + int fd; |
| 1719 | if (catname && cattarget(file) < 0) { |
| 1720 | error("Cannot set file name."); |
| 1721 | return; |
| 1722 | @@ -1477,7 +1478,12 @@ |
| 1723 | (void) sprintf(new, "%s/%s", target, tempname); |
| 1724 | *file = '/'; |
| 1725 | } |
| 1726 | - (void) mktemp(new); |
| 1727 | + fd = mkstemp(new); |
| 1728 | + if (fd < 0) { |
| 1729 | + error("Cannot set file name."); |
| 1730 | + return; |
| 1731 | + } |
| 1732 | + close(fd); |
| 1733 | } |
| 1734 | |
| 1735 | /* |
| 1736 | @@ -1581,8 +1587,8 @@ |
| 1737 | extern void server() |
| 1738 | { |
| 1739 | static char cmdbuf[BUFSIZ]; |
| 1740 | - register char *cp; |
| 1741 | - register int n; |
| 1742 | + char *cp; |
| 1743 | + int n; |
| 1744 | extern jmp_buf finish_jmpbuf; |
| 1745 | |
| 1746 | if (setjmp(finish_jmpbuf)) { |
| 1747 | --- rdist-6.1.5/src/filesys.c.cleanup 1998-11-10 05:10:18.000000000 +0100 |
| 1748 | +++ rdist-6.1.5/src/filesys.c 2003-12-17 11:38:16.000000000 +0100 |
| 1749 | @@ -38,7 +38,7 @@ |
| 1750 | * SUCH DAMAGE. |
| 1751 | */ |
| 1752 | |
| 1753 | -#ifndef lint |
| 1754 | +#if 0 |
| 1755 | static char RCSid[] = |
| 1756 | "$Id: filesys.c,v 6.25 1998/11/10 04:10:17 mcooper Exp $"; |
| 1757 | |
| 1758 | @@ -72,7 +72,7 @@ |
| 1759 | static char last_pathname[MAXPATHLEN]; |
| 1760 | static char file[MAXPATHLEN + 3]; |
| 1761 | static struct stat filestat; |
| 1762 | - register char *p; |
| 1763 | + char *p; |
| 1764 | |
| 1765 | /* |
| 1766 | * Mark the statbuf as invalid to start with. |
| 1767 | @@ -125,7 +125,7 @@ |
| 1768 | * Normally we want to change /dir1/dir2/file |
| 1769 | * into "/dir1/dir2/." |
| 1770 | */ |
| 1771 | - if (p = (char *) strrchr(file, '/')) { |
| 1772 | + if ((p = (char *) strrchr(file, '/'))) { |
| 1773 | *++p = '.'; |
| 1774 | *++p = CNULL; |
| 1775 | } else { |
| 1776 | @@ -183,7 +183,7 @@ |
| 1777 | struct stat *filest; |
| 1778 | struct mntinfo *mntinfo; |
| 1779 | { |
| 1780 | - register struct mntinfo *mi; |
| 1781 | + struct mntinfo *mi; |
| 1782 | |
| 1783 | for (mi = mntinfo; mi; mi = mi->mi_nxt) { |
| 1784 | if (mi->mi_mnt->me_flags & MEFLAG_IGNORE) |
| 1785 | @@ -202,7 +202,7 @@ |
| 1786 | mntent_t *mnt; |
| 1787 | struct mntinfo *mntinfo; |
| 1788 | { |
| 1789 | - register struct mntinfo *m; |
| 1790 | + struct mntinfo *m; |
| 1791 | |
| 1792 | for (m = mntinfo; m; m = m->mi_nxt) |
| 1793 | if (strcmp(m->mi_mnt->me_path, mnt->me_path) == 0) |
| 1794 | @@ -247,7 +247,7 @@ |
| 1795 | } |
| 1796 | |
| 1797 | mntinfo = mi; |
| 1798 | - while (mnt = getmountent(mfp)) { |
| 1799 | + while ((mnt = getmountent(mfp))) { |
| 1800 | debugmsg(DM_MISC, "mountent = '%s' (%s)", |
| 1801 | mnt->me_path, mnt->me_type); |
| 1802 | |
| 1803 | @@ -308,7 +308,7 @@ |
| 1804 | static struct stat filestat; |
| 1805 | struct stat *pstat; |
| 1806 | struct mntinfo *tmpmi; |
| 1807 | - register mntent_t *mnt; |
| 1808 | + mntent_t *mnt; |
| 1809 | |
| 1810 | /* |
| 1811 | * Use the supplied stat buffer if not NULL or our own. |
| 1812 | @@ -330,16 +330,16 @@ |
| 1813 | /* |
| 1814 | * Find the mnt that pathname is on. |
| 1815 | */ |
| 1816 | - if (mnt = findmnt(pstat, mntinfo)) |
| 1817 | + if ((mnt = findmnt(pstat, mntinfo))) |
| 1818 | return(mnt); |
| 1819 | |
| 1820 | /* |
| 1821 | * We failed to find correct mnt, so maybe it's a newly |
| 1822 | * mounted filesystem. We rebuild mntinfo and try again. |
| 1823 | */ |
| 1824 | - if (tmpmi = makemntinfo(mntinfo)) { |
| 1825 | + if ((tmpmi = makemntinfo(mntinfo))) { |
| 1826 | mntinfo = tmpmi; |
| 1827 | - if (mnt = findmnt(pstat, mntinfo)) |
| 1828 | + if ((mnt = findmnt(pstat, mntinfo))) |
| 1829 | return(mnt); |
| 1830 | } |
| 1831 | |
| 1832 | --- rdist-6.1.5/src/filesys-os.c.cleanup 1998-11-10 05:09:59.000000000 +0100 |
| 1833 | +++ rdist-6.1.5/src/filesys-os.c 2003-12-17 11:38:16.000000000 +0100 |
| 1834 | @@ -38,7 +38,7 @@ |
| 1835 | * SUCH DAMAGE. |
| 1836 | */ |
| 1837 | |
| 1838 | -#ifndef lint |
| 1839 | +#if 0 |
| 1840 | static char RCSid[] = |
| 1841 | "$Id: filesys-os.c,v 6.18 1998/11/10 04:09:58 mcooper Exp $"; |
| 1842 | |
| 1843 | @@ -314,7 +314,7 @@ |
| 1844 | |
| 1845 | bzero((char *)&me, sizeof(mntent_t)); |
| 1846 | |
| 1847 | - if (mntent = getmntent(fptr)) { |
| 1848 | + if ((mntent = getmntent(fptr))) { |
| 1849 | me.me_path = mntent->mnt_dir; |
| 1850 | me.me_type = mntent->mnt_type; |
| 1851 | if (mntent->mnt_opts && hasmntopt(mntent, MNTOPT_RO)) |
| 1852 | --- rdist-6.1.5/src/strcasecmp.c.cleanup 1998-11-10 05:16:52.000000000 +0100 |
| 1853 | +++ rdist-6.1.5/src/strcasecmp.c 2003-12-17 11:38:16.000000000 +0100 |
| 1854 | @@ -51,9 +51,9 @@ |
| 1855 | }; |
| 1856 | |
| 1857 | strcasecmp(s1, s2) |
| 1858 | - register char *s1, *s2; |
| 1859 | + char *s1, *s2; |
| 1860 | { |
| 1861 | - register char *cm = charmap; |
| 1862 | + char *cm = charmap; |
| 1863 | |
| 1864 | while (cm[*s1] == cm[*s2++]) |
| 1865 | if (*s1++ == '\0') |
| 1866 | @@ -62,10 +62,10 @@ |
| 1867 | } |
| 1868 | |
| 1869 | strncasecmp(s1, s2, n) |
| 1870 | - register char *s1, *s2; |
| 1871 | - register int n; |
| 1872 | + char *s1, *s2; |
| 1873 | + int n; |
| 1874 | { |
| 1875 | - register char *cm = charmap; |
| 1876 | + char *cm = charmap; |
| 1877 | |
| 1878 | while (--n >= 0 && cm[*s1] == cm[*s2++]) |
| 1879 | if (*s1++ == '\0') |
| 1880 | --- rdist-6.1.5/src/strtol.c.cleanup 1994-03-17 00:25:50.000000000 +0100 |
| 1881 | +++ rdist-6.1.5/src/strtol.c 2003-12-17 11:38:16.000000000 +0100 |
| 1882 | @@ -54,13 +54,13 @@ |
| 1883 | strtol(nptr, endptr, base) |
| 1884 | char *nptr; |
| 1885 | char **endptr; |
| 1886 | - register int base; |
| 1887 | + int base; |
| 1888 | { |
| 1889 | - register char *s = nptr; |
| 1890 | - register unsigned long acc; |
| 1891 | - register int c; |
| 1892 | - register unsigned long cutoff; |
| 1893 | - register int neg = 0, any, cutlim; |
| 1894 | + char *s = nptr; |
| 1895 | + unsigned long acc; |
| 1896 | + int c; |
| 1897 | + unsigned long cutoff; |
| 1898 | + int neg = 0, any, cutlim; |
| 1899 | |
| 1900 | /* |
| 1901 | * Skip white space and pick up leading +/- sign if any. |
| 1902 | --- rdist-6.1.5/src/regex.c.cleanup 1998-11-10 05:14:28.000000000 +0100 |
| 1903 | +++ rdist-6.1.5/src/regex.c 2003-12-17 11:39:14.000000000 +0100 |
| 1904 | @@ -142,10 +142,8 @@ |
| 1905 | */ |
| 1906 | char * |
| 1907 | re_comp(sp) |
| 1908 | - register char *sp; |
| 1909 | { |
| 1910 | - register int c; |
| 1911 | - register char *ep = expbuf; |
| 1912 | + char *ep = expbuf; |
| 1913 | int cclcnt, numbra = 0; |
| 1914 | char *lastep = 0; |
| 1915 | char bracket[NBRA]; |
| 1916 | @@ -266,10 +264,10 @@ |
| 1917 | */ |
| 1918 | int |
| 1919 | re_exec(p1) |
| 1920 | - register char *p1; |
| 1921 | + char *p1; |
| 1922 | { |
| 1923 | - register char *p2 = expbuf; |
| 1924 | - register int c; |
| 1925 | + char *p2 = expbuf; |
| 1926 | + int c; |
| 1927 | int rv; |
| 1928 | |
| 1929 | for (c = 0; c < NBRA; c++) { |
| 1930 | @@ -306,9 +304,9 @@ |
| 1931 | */ |
| 1932 | static int |
| 1933 | advance(lp, ep) |
| 1934 | - register char *lp, *ep; |
| 1935 | + char *lp, *ep; |
| 1936 | { |
| 1937 | - register char *curlp; |
| 1938 | + char *curlp; |
| 1939 | int ct, i; |
| 1940 | int rv; |
| 1941 | |
| 1942 | @@ -413,10 +411,10 @@ |
| 1943 | } |
| 1944 | |
| 1945 | backref(i, lp) |
| 1946 | - register int i; |
| 1947 | - register char *lp; |
| 1948 | + int i; |
| 1949 | + char *lp; |
| 1950 | { |
| 1951 | - register char *bp; |
| 1952 | + char *bp; |
| 1953 | |
| 1954 | bp = braslist[i]; |
| 1955 | while (*bp++ == *lp++) |
| 1956 | @@ -427,10 +425,10 @@ |
| 1957 | |
| 1958 | int |
| 1959 | cclass(set, c, af) |
| 1960 | - register char *set, c; |
| 1961 | + char *set, c; |
| 1962 | int af; |
| 1963 | { |
| 1964 | - register int n; |
| 1965 | + int n; |
| 1966 | |
| 1967 | if (c == 0) |
| 1968 | return(0); |
| 1969 | --- rdist-6.1.5/include/defs.h.cleanup 2003-12-17 11:38:16.000000000 +0100 |
| 1970 | +++ rdist-6.1.5/include/defs.h 2003-12-17 11:38:16.000000000 +0100 |
| 1971 | @@ -30,11 +30,13 @@ |
| 1972 | #include <grp.h> |
| 1973 | #include <syslog.h> |
| 1974 | #include <setjmp.h> |
| 1975 | +#include <time.h> |
| 1976 | #include <sys/types.h> |
| 1977 | #include <sys/param.h> |
| 1978 | #include <sys/file.h> |
| 1979 | -#include <sys/time.h> |
| 1980 | #include <sys/stat.h> |
| 1981 | +#include <sys/wait.h> |
| 1982 | +#include <sys/socket.h> |
| 1983 | |
| 1984 | #include "version.h" |
| 1985 | #include "config-def.h" |
| 1986 | @@ -48,6 +50,9 @@ |
| 1987 | #endif /* yacc */ |
| 1988 | |
| 1989 | #include <signal.h> |
| 1990 | +#define _REGEX_RE_COMP |
| 1991 | +#include <regex.h> |
| 1992 | + |
| 1993 | |
| 1994 | /* |
| 1995 | * This belongs in os-svr4.h but many SVR4 OS's |
| 1996 | @@ -321,12 +326,11 @@ |
| 1997 | /* |
| 1998 | * Our own declarations. |
| 1999 | */ |
| 2000 | -char *exptilde(); |
| 2001 | char *makestr(); |
| 2002 | char *xcalloc(); |
| 2003 | char *xmalloc(); |
| 2004 | char *xrealloc(); |
| 2005 | -extern char *xbasename(); |
| 2006 | +extern char *exptilde(); |
| 2007 | extern char *getdistoptlist(); |
| 2008 | extern char *getgroupname(); |
| 2009 | extern char *getnlstr(); |
| 2010 | @@ -336,44 +340,75 @@ |
| 2011 | extern char *getversion(); |
| 2012 | extern char *msgparseopts(); |
| 2013 | extern char *searchpath(); |
| 2014 | +extern char *xbasename(); |
| 2015 | +extern int amatch(); |
| 2016 | extern int any(); |
| 2017 | +extern int becomeroot(); |
| 2018 | +extern int becomeuser(); |
| 2019 | +extern int except(); |
| 2020 | +extern int execbrc(); |
| 2021 | +extern int getfilesysinfo(); |
| 2022 | +extern int getsocketpair(); |
| 2023 | extern int init(); |
| 2024 | extern int install(); |
| 2025 | extern int isexec(); |
| 2026 | +extern int is_nfs_mounted(); |
| 2027 | +extern int is_ro_mounted(); |
| 2028 | +extern int is_symlinked(); |
| 2029 | +extern int match(); |
| 2030 | +extern int okname(); |
| 2031 | extern int parsedistopts(); |
| 2032 | +extern int readrem(); |
| 2033 | extern int remline(); |
| 2034 | +extern int response(); |
| 2035 | +extern int rshrcmd(); |
| 2036 | extern int setfiletime(); |
| 2037 | +extern int setnonblocking(); |
| 2038 | extern int spawn(); |
| 2039 | +extern int yylex(); |
| 2040 | +extern int yyparse(); |
| 2041 | extern struct subcmd *makesubcmd(); |
| 2042 | +extern void append(); |
| 2043 | extern void checkhostname(); |
| 2044 | extern void cleanup(); |
| 2045 | extern void complain(); |
| 2046 | +extern void coredump(); |
| 2047 | +extern void define(); |
| 2048 | +extern void docmdargs(); |
| 2049 | extern void docmds(); |
| 2050 | extern void finish(); |
| 2051 | -extern void log(); |
| 2052 | +extern void freelinkinfo(); |
| 2053 | +extern void insert(); |
| 2054 | extern void logmsg(); |
| 2055 | extern void lostconn(); |
| 2056 | extern void markassigned(); |
| 2057 | +extern void msgprconfig(); |
| 2058 | extern void msgprusage(); |
| 2059 | +extern void mysetlinebuf(); |
| 2060 | extern void note(); |
| 2061 | extern void runcmdspecial(); |
| 2062 | extern void runcommand(); |
| 2063 | extern void server(); |
| 2064 | +extern void setargs_settup(); |
| 2065 | extern void setprogname(); |
| 2066 | extern void sighandler(); |
| 2067 | +extern void usage(); |
| 2068 | extern void waitup(); |
| 2069 | +extern void yyerror(); |
| 2070 | +extern WRITE_RETURN_T xwrite(); |
| 2071 | struct namelist *expand(); |
| 2072 | struct namelist *lookup(); |
| 2073 | struct namelist *makenl(); |
| 2074 | -extern WRITE_RETURN_T xwrite(); |
| 2075 | |
| 2076 | #if defined(ARG_TYPE) && ARG_TYPE == ARG_STDARG |
| 2077 | +extern int sendcmd(char cmd, char *fmt, ...); |
| 2078 | extern void debugmsg(int, char *, ...); |
| 2079 | extern void error(char *, ...); |
| 2080 | extern void fatalerr(char *, ...); |
| 2081 | extern void message(int, char *, ...); |
| 2082 | extern void setproctitle(char *fmt, ...); |
| 2083 | #else |
| 2084 | +extern int sendcmd(va_alist); |
| 2085 | extern void debugmsg(); |
| 2086 | extern void error(); |
| 2087 | extern void fatalerr(); |