summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-09-27 13:42:40 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-09-27 13:42:40 +0000
commit7c6d5e78ab915eb9c9809a18fb4a9c58b891dd3d (patch)
tree32cc2c6d7d4af62ac35188f440488bc6254228ae /usr.bin
parenta7ea9f138d18bd470b12f1e9e0f0de174f9b465c (diff)
Rename some variables to match the general format, and avoid exporting
variables that aren't needed
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/cvsd.c24
-rw-r--r--usr.bin/cvs/cvsd.h7
2 files changed, 15 insertions, 16 deletions
diff --git a/usr.bin/cvs/cvsd.c b/usr.bin/cvs/cvsd.c
index bb8ab675d1f..18c503dcc0f 100644
--- a/usr.bin/cvs/cvsd.c
+++ b/usr.bin/cvs/cvsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvsd.c,v 1.9 2004/09/27 12:39:29 jfb Exp $ */
+/* $OpenBSD: cvsd.c,v 1.10 2004/09/27 13:42:39 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -59,10 +59,10 @@ extern char *__progname;
-int foreground = 0;
+int cvsd_fg = 0;
-volatile sig_atomic_t running = 1;
-volatile sig_atomic_t restart = 0;
+volatile sig_atomic_t cvsd_running = 1;
+volatile sig_atomic_t cvsd_restart = 0;
uid_t cvsd_uid = -1;
@@ -100,7 +100,7 @@ cvsd_sighdlr(int signo)
{
switch (signo) {
case SIGHUP:
- restart = 1;
+ cvsd_restart = 1;
break;
case SIGCHLD:
cvsd_sigchld = 1;
@@ -108,7 +108,7 @@ cvsd_sighdlr(int signo)
case SIGINT:
case SIGTERM:
case SIGQUIT:
- running = 0;
+ cvsd_running = 0;
break;
case SIGINFO:
cvsd_siginfo = 1;
@@ -168,7 +168,7 @@ main(int argc, char **argv)
cvs_log_filter(LP_FILTER_UNSET, LP_INFO);
break;
case 'f':
- foreground = 1;
+ cvsd_fg = 1;
break;
case 'g':
cvsd_set(CVSD_SET_GROUP, optarg);
@@ -230,7 +230,7 @@ main(int argc, char **argv)
signal(SIGTERM, cvsd_sighdlr);
signal(SIGCHLD, cvsd_sighdlr);
- if (!foreground && daemon(0, 0) == -1) {
+ if (!cvsd_fg && daemon(0, 0) == -1) {
cvs_log(LP_ERRNO, "failed to become a daemon");
exit(EX_OSERR);
}
@@ -604,10 +604,10 @@ cvsd_parent_loop(void)
pfd = NULL;
for (;;) {
- if (!running)
+ if (!cvsd_running)
break;
- if (restart) {
+ if (cvsd_restart) {
/* restart server */
}
@@ -711,7 +711,7 @@ cvsd_child_loop(void)
pfd[0].events = POLLIN;
timeout = INFTIM;
- while (running) {
+ while (cvsd_running) {
ret = poll(pfd, 1, timeout);
if (ret == -1) {
if (errno == EINTR)
@@ -739,7 +739,7 @@ cvsd_child_loop(void)
case CVSD_MSG_PASSFD:
break;
case CVSD_MSG_SHUTDOWN:
- running = 0;
+ cvsd_running = 0;
break;
default:
cvs_log(LP_ERR,
diff --git a/usr.bin/cvs/cvsd.h b/usr.bin/cvs/cvsd.h
index 64df7547f7e..2e89c3c4432 100644
--- a/usr.bin/cvs/cvsd.h
+++ b/usr.bin/cvs/cvsd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvsd.h,v 1.4 2004/09/25 12:21:43 jfb Exp $ */
+/* $OpenBSD: cvsd.h,v 1.5 2004/09/27 13:42:39 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -79,6 +79,8 @@
#define CVSD_SET_CHMAX 3
#define CVSD_SET_ADDR 4
#define CVSD_SET_SOCK 5
+#define CVSD_SET_USER 6
+#define CVSD_SET_GROUP 7
#define CVSD_ST_UNKNOWN 0
@@ -115,9 +117,6 @@ struct cvsd_addr {
-extern volatile sig_atomic_t running;
-extern volatile sig_atomic_t restart;
-
extern uid_t cvsd_uid;
extern gid_t cvsd_gid;