📄 lock.c
字号:
/* $Revision: 1.8 $**** InterNetNews replacement for C news system locking.*/#include <stdio.h>static char COMMAND[] = "ctlinnd %s Expire process %ld";static int IsLocked;/*** C News debugging function./* ARGSUSED */voidlockdebug(state) int state;{}/*** Lock the news system by telling the server to throttle input.*/voidnewslock(){ char buff[72]; int i; (void)sprintf(buff, COMMAND, "throttle", (long)getpid()); i = system(buff) >> 8; if (i) error("Can't lock"); IsLocked = 1;}/*** Unlock the system and reload the files.*/voidnewsunlock(){ char buff[72]; int i; if (IsLocked) { (void)sprintf(buff, COMMAND, "go", (long)getpid()); i = system(buff) >> 8; if (i) error("Can't reload"); (void)sprintf(buff, "ctlinnd go"); i = system(buff) >> 8; if (i) error("Can't unlock"); IsLocked = 0; }}/*** Print an error message, then unlock the system.*/voiderrunlock(text, arg) char *text; char *arg;{ warning(text, arg); newsunlock(); exit(1); /* NOTREACHED */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -