This stuff has been #if 0'd for ages; put it out of its misery.
While here, remove the global bnode_waiting which is not used for anything.
bnode_SoftInt claims to return a pointer, so return NULL instead of 0.
Change-Id: Ie7b32bbc606a105190d246355f47bd7ea885c6f8
Reviewed-on: http://gerrit.openafs.org/10284
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
#define BNODE_ERROR_COUNT_MAX 16 /* maximum number of retries */
#define BNODE_ERROR_DELAY_MAX 60 /* maximum retry delay (seconds) */
-int bnode_waiting = 0;
static PROCESS bproc_pid; /* pid of waker-upper */
static struct opr_queue allBnodes; /**< List of all bnodes */
static struct opr_queue allProcs; /**< List of all processes for which we're waiting */
/* signalled, probably by incoming signal */
while (1) {
options = WNOHANG;
- bnode_waiting = options | 0x800000;
code = waitpid((pid_t) - 1, &status, options);
- bnode_waiting = 0;
if (code == 0 || code == -1)
break; /* all done */
/* otherwise code has a process id, which we now search for */
/* int asignal = (int) param; */
IOMGR_Cancel(bproc_pid);
- return 0;
+ return NULL;
}
/* Called at signal interrupt level; queues function to be called
bnode_Check(aproc->bnode);
return code;
}
-
-#if 0
-int
-bnode_Deactivate(struct bnode *abnode)
-{
- struct opr_queue *cursor;
- if (!(abnode->flags & BNODE_ACTIVE))
- return BZNOTACTIVE;
-
- if (opr_queue_IsOnQueue(&abnode->q)) {
- tb->flags &= ~BNODE_ACTIVE;
- return 0;
- }
- return BZNOENT;
-}
-#endif
return (char *)afs_error_message(acode);
}
-/* get partition id from a name */
-/* XXX - unused code - could be removed? */
-#if 0
-static afs_int32
-GetPartitionID(char *aname)
-{
- char tc;
- char ascii[3];
-
- tc = *aname;
- if (tc == 0)
- return -1; /* unknown */
- /* numbers go straight through */
- if (tc >= '0' && tc <= '9') {
- return atoi(aname);
- }
- /* otherwise check for vicepa or /vicepa, or just plain "a" */
- ascii[2] = 0;
- if (strlen(aname) <= 2) {
- strcpy(ascii, aname);
- } else if (!strncmp(aname, "/vicep", 6)) {
- strncpy(ascii, aname + 6, 2);
- } else if (!strncmp(aname, "vicep", 5)) {
- strncpy(ascii, aname + 5, 2);
- } else
- return -1; /* bad partition name */
- /* now partitions are named /vicepa ... /vicepz, /vicepaa, /vicepab,
- * .../vicepzz, and are numbered from 0. Do the appropriate conversion */
- if (ascii[1] == 0) {
- /* one char name, 0..25 */
- if (ascii[0] < 'a' || ascii[0] > 'z')
- return -1; /* wrongo */
- return ascii[0] - 'a';
- } else {
- /* two char name, 26 .. <whatever> */
- if (ascii[0] < 'a' || ascii[0] > 'z')
- return -1; /* wrongo */
- if (ascii[1] < 'a' || ascii[1] > 'z')
- return -1; /* just as bad */
- return (ascii[0] - 'a') * 26 + (ascii[1] - 'a') + 26;
- }
-}
-#endif
-
/* make ctime easier to use */
static char *
DateOf(time_t atime)
}
#endif
-#if 0
-/*
- * This routine causes the calling process to go into the background and
- * to lose its controlling tty.
- *
- * It does not close or otherwise alter the standard file descriptors.
- *
- * It writes warning messages to the standard error output if certain
- * fundamental errors occur.
- *
- * This routine has been tested on:
- *
- * AIX 4.2
- * Digital Unix 4.0D
- * HP-UX 11.0
- * IRIX 6.5
- * Linux 2.1.125
- * Solaris 2.5
- * Solaris 2.6
- */
-
-#ifndef AFS_NT40_ENV
-static void
-background(void)
-{
- /*
- * A process is a process group leader if its process ID
- * (getpid()) and its process group ID (getpgrp()) are the same.
- */
-
- /*
- * To create a new session (and thereby lose our controlling
- * terminal) we cannot be a process group leader.
- *
- * To guarantee we are not a process group leader, we fork and
- * let the parent process exit.
- */
-
- if (getpid() == getpgrp()) {
- pid_t pid;
- pid = fork();
- switch (pid) {
- case -1:
- abort(); /* leave footprints */
- break;
- case 0: /* child */
- break;
- default: /* parent */
- exit(0);
- break;
- }
- }
-
- /*
- * By here, we are not a process group leader, so we can make a
- * new session and become the session leader.
- */
-
- {
- pid_t sid = setsid();
-
- if (sid == -1) {
- static char err[] = "bosserver: WARNING: setsid() failed\n";
- write(STDERR_FILENO, err, sizeof err - 1);
- }
- }
-
- /*
- * Once we create a new session, the current process is a
- * session leader without a controlling tty.
- *
- * On some systems, the first tty device the session leader
- * opens automatically becomes the controlling tty for the
- * session.
- *
- * So, to guarantee we do not acquire a controlling tty, we fork
- * and let the parent process exit. The child process is not a
- * session leader, and so it will not acquire a controlling tty
- * even if it should happen to open a tty device.
- */
-
- if (getpid() == getpgrp()) {
- pid_t pid;
- pid = fork();
- switch (pid) {
- case -1:
- abort(); /* leave footprints */
- break;
- case 0: /* child */
- break;
- default: /* parent */
- exit(0);
- break;
- }
- }
-
- /*
- * check that we no longer have a controlling tty
- */
-
- {
- int fd;
-
- fd = open("/dev/tty", O_RDONLY);
-
- if (fd >= 0) {
- static char err[] =
- "bosserver: WARNING: /dev/tty still attached\n";
- close(fd);
- write(STDERR_FILENO, err, sizeof err - 1);
- }
- }
-}
-#endif /* ! AFS_NT40_ENV */
-#endif
-
static char *
make_pid_filename(char *ainst, char *aname)
{
else
chdir(AFSDIR_SERVER_LOGS_DIRPATH);
-#if 0
- fputs(AFS_GOVERNMENT_MESSAGE, stdout);
- fflush(stdout);
-#endif
-
/* go into the background and remove our controlling tty, close open
file desriptors
*/