From: mar Date: Fri, 8 Sep 1989 17:57:54 +0000 (+0000) Subject: moved directory definitions X-Git-Tag: ASRSNAP1001~33 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/e6eb3546273619debf0ae1e9c065144fd60cc2a9 moved directory definitions --- diff --git a/dcm/startdcm.c b/dcm/startdcm.c index 6a36c6b1..7ba2b07b 100644 --- a/dcm/startdcm.c +++ b/dcm/startdcm.c @@ -23,10 +23,9 @@ static char *rcsid_sms_starter_c = "$Header$"; #include #include #include +#include -#define SMS_LOG_FILE "/u1/sms/dcm.log" - -#define SMS_PROG "/u1/sms/bin/dcm" +#define PROG "dcm" int rdpipe[2]; char *sigdescr[] = { @@ -106,9 +105,10 @@ main(argc, argv) setreuid(0); signal(SIGCHLD, cleanup); - logf = open(SMS_LOG_FILE, O_CREAT|O_WRONLY|O_APPEND, 0640); + sprintf(buf, "%s/%s.log", SMS_DIR, PROG); + logf = open(buf, O_CREAT|O_WRONLY|O_APPEND, 0640); if (logf<0) { - perror(SMS_LOG_FILE); + perror(buf); exit(1); } inf = open("/dev/null", O_RDONLY , 0); @@ -131,6 +131,7 @@ main(argc, argv) tty = open("/dev/tty"); ioctl(tty, TIOCNOTTY, 0); close(tty); + sprintf(buf, "%s/%s", BIN_DIR, PROG); if ((pid = fork()) == 0) { @@ -138,7 +139,7 @@ main(argc, argv) dup2(rdpipe[1], 1); dup2(1,2); for (i = 3; i #include #include +#include -#define SMS_LOG_FILE "/u1/sms/reg_svr.log" - -#define SMS_PROG "/u1/sms/bin/reg_svr" +#define PROG "reg_svr" int rdpipe[2]; char *sigdescr[] = { @@ -106,9 +105,10 @@ main(argc, argv) setreuid(0); signal(SIGCHLD, cleanup); - logf = open(SMS_LOG_FILE, O_CREAT|O_WRONLY|O_APPEND, 0640); + sprintf(buf, "%s/%s.log", SMS_DIR, PROG); + logf = open(buf, O_CREAT|O_WRONLY|O_APPEND, 0640); if (logf<0) { - perror(SMS_LOG_FILE); + perror(buf); exit(1); } inf = open("/dev/null", O_RDONLY , 0); @@ -131,6 +131,7 @@ main(argc, argv) tty = open("/dev/tty"); ioctl(tty, TIOCNOTTY, 0); close(tty); + sprintf(buf, "%s/%s", BIN_DIR, PROG); if ((pid = fork()) == 0) { @@ -138,7 +139,7 @@ main(argc, argv) dup2(rdpipe[1], 1); dup2(1,2); for (i = 3; i #include #include +#include -#define SMS_LOG_FILE "/u1/sms/sms.log" - -#define SMS_PROG "/u1/sms/bin/smsd" +#define PROG "smsd" int rdpipe[2]; char *sigdescr[] = { @@ -107,9 +106,10 @@ main(argc, argv) setreuid(0); signal(SIGCHLD, cleanup); - logf = open(SMS_LOG_FILE, O_CREAT|O_WRONLY|O_APPEND, 0640); + sprintf(buf, "%s/sms.log", SMS_DIR); + logf = open(buf, O_CREAT|O_WRONLY|O_APPEND, 0640); if (logf<0) { - perror(SMS_LOG_FILE); + perror(buf); exit(1); } inf = open("/dev/null", O_RDONLY , 0); @@ -132,6 +132,7 @@ main(argc, argv) tty = open("/dev/tty"); ioctl(tty, TIOCNOTTY, 0); close(tty); + sprintf(buf, "%s/%s", BIN_DIR, PROG); if ((pid = fork()) == 0) { @@ -139,7 +140,7 @@ main(argc, argv) dup2(rdpipe[1], 1); dup2(1,2); for (i = 3; i