Moved semafore directory to ~/var/sema

This commit is contained in:
Michiel Broek
2004-09-14 20:37:57 +00:00
parent d9c5d0eb54
commit eb1e9a6fe9
21 changed files with 46 additions and 37 deletions

View File

@@ -246,8 +246,7 @@ int Wait(void)
int Waiting = 3600;
char buf[PATH_MAX];
sprintf(buf, "%s/sema/upsdown", getenv("MBSE_ROOT"));
if (file_exist(buf, R_OK) == 0)
if (IsSema((char *)"upsdown"))
Waiting = 30;
Syslog('+', "Waiting for the BBS to become free, timeout %d seconds", Waiting);

View File

@@ -89,7 +89,7 @@ void menu()
{
FILE *pMenuFile;
int iFoundKey = FALSE, Key, IsANSI;
char *Input, *Semfile, *sMenuPathFileName, buf[81];
char *Input, *sMenuPathFileName, buf[81];
Input = calloc(PATH_MAX, sizeof(char));
sMenuPathFileName = calloc(PATH_MAX, sizeof(char));
@@ -175,17 +175,13 @@ void menu()
/*
* Check the upsdown semafore
*/
Semfile = calloc(PATH_MAX, sizeof(char));
sprintf(Semfile, "%s/sema/upsdown", getenv("MBSE_ROOT"));
if (file_exist(Semfile, R_OK) == 0) {
if (IsSema((char *)"upsdown")) {
fclose(pMenuFile);
Syslog('+', "Kicking user out, upsdown semafore detected");
printf("System power failure, closing the bbs\n\n");
free(Semfile);
sleep(3);
Good_Bye(MBERR_OK);
}
free(Semfile);
/*
* Check if SysOp wants to chat to user everytime user gets prompt.