#include <sys/wait.h>
#include <sys/signal.h>
#include <sys/ioctl.h>
+#include <sms_app.h>
-#define SMS_LOG_FILE "/u1/sms/dcm.log"
-
-#define SMS_PROG "/u1/sms/bin/dcm"
+#define PROG "dcm"
int rdpipe[2];
char *sigdescr[] = {
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);
tty = open("/dev/tty");
ioctl(tty, TIOCNOTTY, 0);
close(tty);
+ sprintf(buf, "%s/%s", BIN_DIR, PROG);
if ((pid = fork()) == 0) {
dup2(rdpipe[1], 1);
dup2(1,2);
for (i = 3; i <nfds; i++) close(i);
- execl(SMS_PROG, "dcm", 0);
+ execl(buf, PROG, 0);
perror("cannot run dcm");
exit(1);
}
#define HARD_FAIL(x) (((x) != 0 ) && ((x) != SMS_NO_CHANGE))
#define SOFT_FAIL(x) (((x) == SMS_NO_MEM) || ((x) == SMS_CANT_CONNECT) || ((x) == SMS_CCONFIG) || ((x) == SMS_DEADLOCK))
-#define SMS_DIR "/u1/sms"
-#define LOCK_DIR "/u1/sms/dcm/locks"
#define UMASK 0007
extern char *malloc(), *calloc(), *realloc();
#include <sys/wait.h>
#include <sys/signal.h>
#include <sys/ioctl.h>
+#include <sms_app.h>
-#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[] = {
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);
tty = open("/dev/tty");
ioctl(tty, TIOCNOTTY, 0);
close(tty);
+ sprintf(buf, "%s/%s", BIN_DIR, PROG);
if ((pid = fork()) == 0) {
dup2(rdpipe[1], 1);
dup2(1,2);
for (i = 3; i <nfds; i++) close(i);
- execl(SMS_PROG, "reg_svr", 0);
+ execl(buf, PROG, 0);
perror("cannot run reg_svr");
exit(1);
}
#include <sys/wait.h>
#include <sys/signal.h>
#include <sys/ioctl.h>
+#include <sms_app.h>
-#define SMS_LOG_FILE "/u1/sms/sms.log"
-
-#define SMS_PROG "/u1/sms/bin/smsd"
+#define PROG "smsd"
int rdpipe[2];
char *sigdescr[] = {
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);
tty = open("/dev/tty");
ioctl(tty, TIOCNOTTY, 0);
close(tty);
+ sprintf(buf, "%s/%s", BIN_DIR, PROG);
if ((pid = fork()) == 0) {
dup2(rdpipe[1], 1);
dup2(1,2);
for (i = 3; i <nfds; i++) close(i);
- execl(SMS_PROG, "smsd", 0);
+ execl(buf, PROG, 0);
perror("cannot run smsd");
exit(1);
}