Update commands to use paths from <minix/paths.h> instead of

hard-coding them (some)
This commit is contained in:
Ben Gras 2005-08-26 12:14:54 +00:00
parent 4caadca5e0
commit efdae0743d
9 changed files with 32 additions and 18 deletions

View File

@ -5,11 +5,13 @@
#define nil ((void*)0) #define nil ((void*)0)
#include <minix/paths.h>
/* Paths to files. */ /* Paths to files. */
#define PATH_DHCPCONF "/etc/dhcp.conf" #define PATH_DHCPCONF _PATH_DHCPCONF
#define PATH_DHCPPID "/usr/run/dhcpd.pid" #define PATH_DHCPPID _PATH_DHCPPID
#define PATH_DHCPCACHE "/usr/adm/dhcp.cache" #define PATH_DHCPCACHE _PATH_DHCPCACHE
#define PATH_DHCPPOOL "/usr/adm/dhcp.pool" #define PATH_DHCPPOOL _PATH_DHCPPOOL
#define CLID_MAX 32 /* Maximum client ID length. */ #define CLID_MAX 32 /* Maximum client ID length. */

View File

@ -97,8 +97,10 @@ struct person { /* one for each person fingered */
char hostt[HMAX+1]; /* login host */ char hostt[HMAX+1]; /* login host */
}; };
char LASTLOG[] = "/usr/adm/lastlog"; /* last login info */ #include <minix/paths.h>
char USERLOG[] = "/etc/utmp"; /* who is logged in */
char LASTLOG[] = _PATH_LASTLOG; /* last login info */
char USERLOG[] = _PATH_UTMP; /* who is logged in */
char PLAN[] = "/.plan"; /* what plan file is */ char PLAN[] = "/.plan"; /* what plan file is */
char PROJ[] = "/.project"; /* what project file */ char PROJ[] = "/.project"; /* what project file */

View File

@ -30,9 +30,11 @@ Created: Jan 27, 1992 by Philip Homburg
#include <net/gen/resolv.h> #include <net/gen/resolv.h>
#include <net/gen/dhcp.h> #include <net/gen/dhcp.h>
#include <minix/paths.h>
char *prog_name; char *prog_name;
char DHCPCACHE[]="/usr/adm/dhcp.cache"; char DHCPCACHE[]=_PATH_DHCPCACHE;
void main _ARGS(( int argc, char *argv[] )); void main _ARGS(( int argc, char *argv[] ));
void usage _ARGS(( void )); void usage _ARGS(( void ));

View File

@ -57,6 +57,7 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <minix/paths.h>
#define FALSE 0 #define FALSE 0
#define TRUE 1 #define TRUE 1
@ -307,7 +308,7 @@ long to;
*/ */
void Print_Uptime() void Print_Uptime()
{ {
char *utmp_file = "/etc/utmp"; char *utmp_file = _PATH_UTMP;
unsigned nusers; unsigned nusers;
struct utmp ut; struct utmp ut;
FILE *uf; FILE *uf;
@ -380,7 +381,7 @@ int main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
{ {
char *wtmp_file = "/usr/adm/wtmp"; char *wtmp_file = _PATH_WTMP;
FILE *f; FILE *f;
long size; /* Number of wtmp records in the file */ long size; /* Number of wtmp records in the file */
int wtmp_count; /* How many to read into wtmp_buffer */ int wtmp_count; /* How many to read into wtmp_buffer */

View File

@ -75,11 +75,12 @@
#include <time.h> #include <time.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <minix/minlib.h> #include <minix/minlib.h>
#include <minix/paths.h>
char PATH_UTMP[] = "/etc/utmp"; /* current logins */ char PATH_UTMP[] = _PATH_UTMP; /* current logins */
char PATH_WTMP[] = "/usr/adm/wtmp"; /* login/logout history */ char PATH_WTMP[] = _PATH_WTMP; /* login/logout history */
char PATH_LASTLOG[] = "/usr/adm/lastlog"; /* last login history */ char PATH_LASTLOG[] = _PATH_LASTLOG; /* last login history */
char PATH_MOTD[] = "/etc/motd"; /* message of the day */ char PATH_MOTD[] = _PATH_MOTD; /* message of the day */
#define TTY_GID 4 /* group ID of ttys */ #define TTY_GID 4 /* group ID of ttys */

View File

@ -23,7 +23,9 @@
#include <utmp.h> #include <utmp.h>
#include <errno.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(void usage , (void));
_PROTOTYPE(int main , (int argc , char *argv [])); _PROTOTYPE(int main , (int argc , char *argv []));

View File

@ -40,6 +40,8 @@ static const char version[] = "2.7";
#include <net/gen/udp_io.h> #include <net/gen/udp_io.h>
#include <net/gen/dhcp.h> #include <net/gen/dhcp.h>
#include <minix/paths.h>
#define HTTL 3600L /* Default time to live for /etc/hosts data. */ #define HTTL 3600L /* Default time to live for /etc/hosts data. */
#define SHORT_TIMEOUT 2 /* If you expect an answer soon. */ #define SHORT_TIMEOUT 2 /* If you expect an answer soon. */
#define MEDIUM_TIMEOUT 4 /* Soon, but not that 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) #define DO_TCP (__minix_vmd || !__minix)
/* Host data, file to store our process id in, our cache, DHCP's cache. */ /* 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 PIDFILE[]= "/usr/run/nonamed.pid";
static char NNCACHE[]= "/usr/adm/nonamed.cache"; 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. */ /* Magic string to head the cache file. */
static char MAGIC[4]= "NND\2"; static char MAGIC[4]= "NND\2";

View File

@ -10,8 +10,9 @@
#include <utmp.h> #include <utmp.h>
#include <time.h> #include <time.h>
#include <string.h> #include <string.h>
#include <minix/paths.h>
char PATH_UTMP[] = "/etc/utmp"; char PATH_UTMP[] = _PATH_UTMP;
char day[] = "SunMonTueWedThuFriSat"; char day[] = "SunMonTueWedThuFriSat";
char month[] = "JanFebMarAprMayJunJulAugSepOctNovDec"; char month[] = "JanFebMarAprMayJunJulAugSepOctNovDec";

View File

@ -25,6 +25,7 @@
#include <utmp.h> #include <utmp.h>
#include <time.h> #include <time.h>
#include <stdio.h> #include <stdio.h>
#include <minix/paths.h>
static char *Version = "@(#) WRITE 1.6 (10/24/92)"; 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", if (verbose) fprintf(stderr, "Trying to write to %s\n",
userptr->pw_gecos); 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"); fprintf(stderr, "Cannot open utmp file\n");
return(NULL); return(NULL);
} }