Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
16c82193
Commit
16c82193
authored
25 years ago
by
Fredrik Noring
Browse files
Options
Downloads
Patches
Plain Diff
More file closing.
Rev: lib/modules/Yabu.pmod/module.pmod:1.15
parent
48bfd119
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Yabu.pmod/module.pmod
+10
-7
10 additions, 7 deletions
lib/modules/Yabu.pmod/module.pmod
with
10 additions
and
7 deletions
lib/modules/Yabu.pmod/module.pmod
+
10
−
7
View file @
16c82193
...
...
@@ -4,7 +4,7 @@
* associated with a unique key.
*/
constant cvs_id = "$Id: module.pmod,v 1.1
4
1999/08/30
06:22:07 hubbe
Exp $";
constant cvs_id = "$Id: module.pmod,v 1.1
5
1999/08/30
10:01:28 noring
Exp $";
#define ERR(msg) throw(({ "(Yabu) "+msg+"\n", backtrace() }))
#define IO_ERR(msg) throw(({ sprintf("(Yabu) %s, %s (%d)\n",msg,strerror(errno()),errno()),backtrace() }))
...
...
@@ -127,7 +127,7 @@ class YabuLog {
static private class FileIO {
INHERIT_MUTEX
static private inherit Stdio.File:file;
static private string filemode;
static private string
filename,
filemode;
static private void seek(int offset)
{
...
...
@@ -171,16 +171,18 @@ static private class FileIO {
file::close();
}
void file_open(string filename)
void file_open(string
_
filename)
{
filename = _filename;
if(!file::open(filename, filemode))
ERR(strerror(file::errno()));
}
void create(string filename, string _filemode)
void create(string
_
filename, string _filemode)
{
file::create();
filename = _filename;
filemode = _filemode;
file_open(filename);
}
...
...
@@ -454,6 +456,7 @@ class Chunk {
LOCK();
if(!write)
ERR("Cannot purge in read mode");
file::file_close();
rm(filename);
keys = 0;
frees = 0;
...
...
@@ -467,11 +470,11 @@ class Chunk {
LOCK();
if(!write)
ERR("Cannot move in read mode");
file_close();
file::
file_close();
if(!mv(filename, new_filename))
IO_ERR("Move failed");
filename = new_filename;
file_open(filename);
file::
file_open(filename);
UNLOCK();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment