(file_lock, file_unlock, ef_lock, ef_unlock, commlock, communlock):

File locking doesn't make sense, must be a leftover from the distant
past.  Remove.  Callers changed.
This commit is contained in:
Markus Armbruster 2004-01-29 17:07:26 +00:00
parent daad9ed79c
commit beba530119
11 changed files with 2 additions and 191 deletions

View file

@ -238,14 +238,12 @@ diss(void)
putloan(ni.cur, &loan);
}
/* clean up commodity and trade for this nation. */
commlock();
commread();
for (n = 1; n < I_MAX + 1; n++) {
val = commamt(player->cnum, n, &dummy);
commset(player->cnum, n, -val);
}
commwrite();
communlock();
snxtitem_all(&ni, EF_TRADE);
while (nxtitem(&ni, (s_char *)&trade)) {
if (trade.trd_unitid >= 0 && trade.trd_owner == player->cnum) {

View file

@ -105,12 +105,7 @@ multsingle(natid us, natid them, struct natstr *natp)
price = minmult;
if (price >= maxmult)
price = maxmult;
if (!commlock()) {
pr("Unable to lock commodity file; get help!\n");
return;
}
if (commread() < 0) {
(void)communlock();
pr("Unable to re-read commodity file; get help!\n");
return;
}
@ -118,5 +113,4 @@ multsingle(natid us, natid them, struct natstr *natp)
if (commwrite() < 0) {
pr("Unable to write out commodity file; get help!\n");
}
(void)communlock();
}

View file

@ -127,10 +127,6 @@ set(void)
}
if ((price = atoi(p)) < 0)
continue;
if (!ef_lock(EF_TRADE)) {
logerror("can't lock trade file");
return RET_SYS;
}
foundslot = -1;
freeslot = -1;
snxtitem_all(&ni_trade, EF_TRADE);
@ -178,7 +174,6 @@ set(void)
trade_nameof(&trade, &item), ni.cur,
id, foundslot >= 0 ? "reset" : "set", price);
}
ef_unlock(EF_TRADE);
}
return RET_OK;
}