mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Style.
This commit is contained in:
parent
dfe3ac2caf
commit
7c01c50390
@ -42,7 +42,8 @@ static const struct tbl
|
||||
{
|
||||
const char* tbl_string;
|
||||
SSHORT tbl_code;
|
||||
} types[] = {
|
||||
} types[] =
|
||||
{
|
||||
{"null", LCK_null},
|
||||
{"pr", LCK_PR},
|
||||
{"sr", LCK_SR},
|
||||
@ -56,7 +57,8 @@ static const struct tagg
|
||||
{
|
||||
const char* tagg_string;
|
||||
SSHORT tagg_code;
|
||||
} aggs[] = {
|
||||
} aggs[] =
|
||||
{
|
||||
{"min", LCK_MIN},
|
||||
{"max", LCK_MAX},
|
||||
{"cnt", LCK_CNT},
|
||||
@ -92,7 +94,8 @@ void main( int argc, char **argv)
|
||||
printf("pid = %d\n\n", getpid());
|
||||
printf("\n");
|
||||
|
||||
if (LOCK_init(status_vector, getpid(), 1, &lck_owner_handle)) {
|
||||
if (LOCK_init(status_vector, getpid(), 1, &lck_owner_handle))
|
||||
{
|
||||
printf("LOCK_init failed\n");
|
||||
isc_print_status(status_vector);
|
||||
exit(0);
|
||||
@ -123,7 +126,8 @@ void main( int argc, char **argv)
|
||||
if (!strcmp(op, "rel"))
|
||||
{
|
||||
const SSHORT n = atoi(arg);
|
||||
if (n < slot && (lock = locks[n])) {
|
||||
if (n < slot && (lock = locks[n]))
|
||||
{
|
||||
LOCK_deq(lock);
|
||||
locks[n] = 0;
|
||||
}
|
||||
@ -146,7 +150,8 @@ void main( int argc, char **argv)
|
||||
if (!strcmp(op, "rd"))
|
||||
{
|
||||
const SSHORT n = atoi(arg);
|
||||
if (n >= slot || !(lock = locks[n])) {
|
||||
if (n >= slot || !(lock = locks[n]))
|
||||
{
|
||||
printf("bad lock\n");
|
||||
continue;
|
||||
}
|
||||
@ -157,7 +162,8 @@ void main( int argc, char **argv)
|
||||
if (!strcmp(op, "wd"))
|
||||
{
|
||||
const SSHORT n = atoi(arg);
|
||||
if (n >= slot || !(lock = locks[n])) {
|
||||
if (n >= slot || !(lock = locks[n]))
|
||||
{
|
||||
printf("bad lock\n");
|
||||
continue;
|
||||
}
|
||||
@ -169,7 +175,8 @@ void main( int argc, char **argv)
|
||||
if (!strcmp(op, "qd"))
|
||||
{
|
||||
const SSHORT agg = lookup_agg(arg);
|
||||
if (!agg) {
|
||||
if (!agg)
|
||||
{
|
||||
printf("bad query aggregate\n");
|
||||
continue;
|
||||
}
|
||||
@ -184,11 +191,13 @@ void main( int argc, char **argv)
|
||||
{
|
||||
const SSHORT n = atoi(arg);
|
||||
scanf("%s", op);
|
||||
if (!(type = lookup_lock(op))) {
|
||||
if (!(type = lookup_lock(op)))
|
||||
{
|
||||
printf("bad lock type\n");
|
||||
continue;
|
||||
}
|
||||
if (n >= slot || !(lock = locks[n])) {
|
||||
if (n >= slot || !(lock = locks[n]))
|
||||
{
|
||||
printf("bad lock\n");
|
||||
continue;
|
||||
}
|
||||
@ -224,12 +233,14 @@ void main( int argc, char **argv)
|
||||
type, /* lock type */
|
||||
(sw_release ? ast : NULL), slot, /* AST and argument */
|
||||
0, wait, status_vector, lck_owner_handle);
|
||||
if (lock) {
|
||||
if (lock)
|
||||
{
|
||||
printf("lock# %d = %d\n", slot, lock);
|
||||
levels[slot] = type;
|
||||
locks[slot++] = lock;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
printf("*** LOCK REJECTED: status_vector[1] = %d", status_vector[1]);
|
||||
switch (status_vector[1])
|
||||
{
|
||||
@ -274,18 +285,21 @@ static int ast(void* slot_void)
|
||||
|
||||
printf("*** blocking AST for lock# %d ", slot);
|
||||
|
||||
if (sw_release < 0) {
|
||||
if (sw_release < 0)
|
||||
{
|
||||
printf("In the AST routine.\n");
|
||||
printf("Enter ar value [1=nothing, 2=release, 3=downgrade]:");
|
||||
scanf("%d", &sw_release_use);
|
||||
}
|
||||
|
||||
if (sw_release_use == 1) {
|
||||
if (sw_release_use == 1)
|
||||
{
|
||||
printf("-- ignored ***\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sw_release_use > 2 && levels[slot] == LCK_EX) {
|
||||
if (sw_release_use > 2 && levels[slot] == LCK_EX)
|
||||
{
|
||||
LOCK_convert(locks[slot], LCK_SR, wait, NULL, 0, status_vector);
|
||||
levels[slot] = LCK_SR;
|
||||
printf("-- down graded to SR ***\n");
|
||||
|
@ -191,14 +191,20 @@ int CLIB_ROUTINE main( int argc, char *argv[])
|
||||
redir_err = _open_osfhandle(redir_err, 0);
|
||||
#endif
|
||||
if (redir_in != 0)
|
||||
{
|
||||
if (dup2((int) redir_in, 0))
|
||||
close((int) redir_in);
|
||||
}
|
||||
if (redir_out != 1)
|
||||
{
|
||||
if (dup2((int) redir_out, 1))
|
||||
close((int) redir_out);
|
||||
}
|
||||
if (redir_err != 2)
|
||||
{
|
||||
if (dup2((int) redir_err, 2))
|
||||
close((int) redir_err);
|
||||
}
|
||||
argv += 4;
|
||||
argc -= 4;
|
||||
}
|
||||
@ -961,8 +967,7 @@ static void prt_history(OUTFILE outfile,
|
||||
}
|
||||
|
||||
|
||||
static void prt_lock(OUTFILE outfile,
|
||||
const lhb* LOCK_header, lbl* lock, USHORT sw_series)
|
||||
static void prt_lock(OUTFILE outfile, const lhb* LOCK_header, lbl* lock, USHORT sw_series)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user