Update commands to use paths from <minix/paths.h> instead of
hard-coding them (some)
This commit is contained in:
parent
4caadca5e0
commit
efdae0743d
9 changed files with 32 additions and 18 deletions
|
@ -5,11 +5,13 @@
|
|||
|
||||
#define nil ((void*)0)
|
||||
|
||||
#include <minix/paths.h>
|
||||
|
||||
/* Paths to files. */
|
||||
#define PATH_DHCPCONF "/etc/dhcp.conf"
|
||||
#define PATH_DHCPPID "/usr/run/dhcpd.pid"
|
||||
#define PATH_DHCPCACHE "/usr/adm/dhcp.cache"
|
||||
#define PATH_DHCPPOOL "/usr/adm/dhcp.pool"
|
||||
#define PATH_DHCPCONF _PATH_DHCPCONF
|
||||
#define PATH_DHCPPID _PATH_DHCPPID
|
||||
#define PATH_DHCPCACHE _PATH_DHCPCACHE
|
||||
#define PATH_DHCPPOOL _PATH_DHCPPOOL
|
||||
|
||||
#define CLID_MAX 32 /* Maximum client ID length. */
|
||||
|
||||
|
|
|
@ -97,8 +97,10 @@ struct person { /* one for each person fingered */
|
|||
char hostt[HMAX+1]; /* login host */
|
||||
};
|
||||
|
||||
char LASTLOG[] = "/usr/adm/lastlog"; /* last login info */
|
||||
char USERLOG[] = "/etc/utmp"; /* who is logged in */
|
||||
#include <minix/paths.h>
|
||||
|
||||
char LASTLOG[] = _PATH_LASTLOG; /* last login info */
|
||||
char USERLOG[] = _PATH_UTMP; /* who is logged in */
|
||||
char PLAN[] = "/.plan"; /* what plan file is */
|
||||
char PROJ[] = "/.project"; /* what project file */
|
||||
|
||||
|
|
|
@ -30,9 +30,11 @@ Created: Jan 27, 1992 by Philip Homburg
|
|||
#include <net/gen/resolv.h>
|
||||
#include <net/gen/dhcp.h>
|
||||
|
||||
#include <minix/paths.h>
|
||||
|
||||
char *prog_name;
|
||||
|
||||
char DHCPCACHE[]="/usr/adm/dhcp.cache";
|
||||
char DHCPCACHE[]=_PATH_DHCPCACHE;
|
||||
|
||||
void main _ARGS(( int argc, char *argv[] ));
|
||||
void usage _ARGS(( void ));
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <minix/paths.h>
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
@ -307,7 +308,7 @@ long to;
|
|||
*/
|
||||
void Print_Uptime()
|
||||
{
|
||||
char *utmp_file = "/etc/utmp";
|
||||
char *utmp_file = _PATH_UTMP;
|
||||
unsigned nusers;
|
||||
struct utmp ut;
|
||||
FILE *uf;
|
||||
|
@ -380,7 +381,7 @@ int main(argc, argv)
|
|||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
char *wtmp_file = "/usr/adm/wtmp";
|
||||
char *wtmp_file = _PATH_WTMP;
|
||||
FILE *f;
|
||||
long size; /* Number of wtmp records in the file */
|
||||
int wtmp_count; /* How many to read into wtmp_buffer */
|
||||
|
|
|
@ -75,11 +75,12 @@
|
|||
#include <time.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <minix/minlib.h>
|
||||
#include <minix/paths.h>
|
||||
|
||||
char PATH_UTMP[] = "/etc/utmp"; /* current logins */
|
||||
char PATH_WTMP[] = "/usr/adm/wtmp"; /* login/logout history */
|
||||
char PATH_LASTLOG[] = "/usr/adm/lastlog"; /* last login history */
|
||||
char PATH_MOTD[] = "/etc/motd"; /* message of the day */
|
||||
char PATH_UTMP[] = _PATH_UTMP; /* current logins */
|
||||
char PATH_WTMP[] = _PATH_WTMP; /* login/logout history */
|
||||
char PATH_LASTLOG[] = _PATH_LASTLOG; /* last login history */
|
||||
char PATH_MOTD[] = _PATH_MOTD; /* message of the day */
|
||||
|
||||
#define TTY_GID 4 /* group ID of ttys */
|
||||
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
#include <utmp.h>
|
||||
#include <errno.h>
|
||||
|
||||
char PATH_UTMP[] = "/etc/utmp"; /* current logins */
|
||||
#include <minix/paths.h>
|
||||
|
||||
char PATH_UTMP[] = _PATH_UTMP; /* current logins */
|
||||
|
||||
_PROTOTYPE(void usage , (void));
|
||||
_PROTOTYPE(int main , (int argc , char *argv []));
|
||||
|
|
|
@ -40,6 +40,8 @@ static const char version[] = "2.7";
|
|||
#include <net/gen/udp_io.h>
|
||||
#include <net/gen/dhcp.h>
|
||||
|
||||
#include <minix/paths.h>
|
||||
|
||||
#define HTTL 3600L /* Default time to live for /etc/hosts data. */
|
||||
#define SHORT_TIMEOUT 2 /* If you expect an answer soon. */
|
||||
#define MEDIUM_TIMEOUT 4 /* Soon, but not that soon. */
|
||||
|
@ -54,10 +56,10 @@ static const char version[] = "2.7";
|
|||
#define DO_TCP (__minix_vmd || !__minix)
|
||||
|
||||
/* Host data, file to store our process id in, our cache, DHCP's cache. */
|
||||
static char HOSTS[]= "/etc/hosts";
|
||||
static char HOSTS[]= _PATH_HOSTS;
|
||||
static char PIDFILE[]= "/usr/run/nonamed.pid";
|
||||
static char NNCACHE[]= "/usr/adm/nonamed.cache";
|
||||
static char DHCPCACHE[]="/usr/adm/dhcp.cache";
|
||||
static char DHCPCACHE[]= _PATH_DHCPCACHE;
|
||||
|
||||
/* Magic string to head the cache file. */
|
||||
static char MAGIC[4]= "NND\2";
|
||||
|
|
|
@ -10,8 +10,9 @@
|
|||
#include <utmp.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <minix/paths.h>
|
||||
|
||||
char PATH_UTMP[] = "/etc/utmp";
|
||||
char PATH_UTMP[] = _PATH_UTMP;
|
||||
|
||||
char day[] = "SunMonTueWedThuFriSat";
|
||||
char month[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <utmp.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <minix/paths.h>
|
||||
|
||||
static char *Version = "@(#) WRITE 1.6 (10/24/92)";
|
||||
|
||||
|
@ -68,7 +69,7 @@ char *finduser()
|
|||
if (verbose) fprintf(stderr, "Trying to write to %s\n",
|
||||
userptr->pw_gecos);
|
||||
|
||||
if ((utmpfd = open("/etc/utmp", O_RDONLY)) < 0) {
|
||||
if ((utmpfd = open(_PATH_UTMP, O_RDONLY)) < 0) {
|
||||
fprintf(stderr, "Cannot open utmp file\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue