tweaks: move a function to be before the ones that call it
This commit is contained in:
22
src/files.c
22
src/files.c
@@ -148,6 +148,17 @@ void set_modified(void)
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* Delete the lockfile. Return -1 if unsuccessful, and 1 otherwise. */
|
||||
int delete_lockfile(const char *lockfilename)
|
||||
{
|
||||
if (unlink(lockfilename) < 0 && errno != ENOENT) {
|
||||
statusline(MILD, _("Error deleting lock file %s: %s"),
|
||||
lockfilename, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Write a lockfile, under the given lockfilename. This ALWAYS annihilates
|
||||
* an existing version of that file. Return 1 on success, and 0 on failure. */
|
||||
int write_lockfile(const char *lockfilename, const char *filename, bool modified)
|
||||
@@ -256,17 +267,6 @@ int write_lockfile(const char *lockfilename, const char *filename, bool modified
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Delete the lockfile. Return -1 if unsuccessful, and 1 otherwise. */
|
||||
int delete_lockfile(const char *lockfilename)
|
||||
{
|
||||
if (unlink(lockfilename) < 0 && errno != ENOENT) {
|
||||
statusline(MILD, _("Error deleting lock file %s: %s"),
|
||||
lockfilename, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Deal with lockfiles. Return -1 on refusing to override the lockfile,
|
||||
* and 1 on successfully creating it; 0 means we were not successful in
|
||||
* creating the lockfile but we should continue to load the file. */
|
||||
|
||||
Reference in New Issue
Block a user