move spool area to /usr/spool/rwho so /etc is always changing
SCCS-vsn: usr.bin/ruptime/ruptime.c 4.7
SCCS-vsn: usr.bin/rwho/rwho.c 4.3
SCCS-vsn: usr.sbin/rwhod/rwhod.c 4.7
SCCS-vsn: include/protocols/rwhod.h 4.3
-/* rwhod.h 4.2 82/11/14 */
+/* rwhod.h 4.3 82/12/24 */
struct whod {
int wd_sendtime;
struct whod {
int wd_sendtime;
int we_idle;
} wd_we[1024 / sizeof (struct whoent)];
};
int we_idle;
} wd_we[1024 / sizeof (struct whoent)];
};
+
+#define RWHODIR "/usr/spool/rwho" /* where data is stored */
-static char sccsid[] = "@(#)ruptime.c 4.6 82/11/14";
+static char sccsid[] = "@(#)ruptime.c 4.7 82/12/24";
#endif
#include <sys/param.h>
#endif
#include <sys/param.h>
argc--, argv++;
goto again;
}
argc--, argv++;
goto again;
}
- if (chdir("/etc") < 0) {
- perror("/etc");
+ if (chdir(RWHODIR) < 0) {
+ perror(RWHODIR);
exit(1);
}
etc = opendir(".");
exit(1);
}
etc = opendir(".");
-static char sccsid[] = "@(#)rwho.c 4.2 82/05/09";
+static char sccsid[] = "@(#)rwho.c 4.3 82/12/24";
#endif
#include <sys/param.h>
#endif
#include <sys/param.h>
goto again;
}
(void) time(&now);
goto again;
}
(void) time(&now);
- if (chdir("/etc") < 0) {
- perror("/etc");
+ if (chdir(RWHODIR) < 0) {
+ perror(RWHODIR);
exit(1);
}
etc = opendir(".");
exit(1);
}
etc = opendir(".");
-static char sccsid[] = "@(#)rwhod.c 4.6 82/11/15";
+static char sccsid[] = "@(#)rwhod.c 4.7 82/12/24";
#endif
#include <sys/types.h>
#endif
#include <sys/types.h>
fprintf(stderr, "rwhod: udp/who: unknown service\n");
exit(1);
}
fprintf(stderr, "rwhod: udp/who: unknown service\n");
exit(1);
}
- sp->s_port = htons(sp->s_port);
#ifndef DEBUG
if (fork())
exit(0);
#ifndef DEBUG
if (fork())
exit(0);
from.sin_addr);
continue;
}
from.sin_addr);
continue;
}
- (void) sprintf(path, "/etc/whod.%s", wd.wd_hostname);
+ (void) sprintf(path, "%s/whod.%s", RWHODIR, wd.wd_hostname);
whod = creat(path, 0666);
if (whod < 0) {
fprintf(stderr, "rwhod: ");
whod = creat(path, 0666);
if (whod < 0) {
fprintf(stderr, "rwhod: ");