HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
[bpt/emacs.git]
/
src
/
filelock.c
diff --git
a/src/filelock.c
b/src/filelock.c
index
194df81
..
769e5aa
100644
(file)
--- a/
src/filelock.c
+++ b/
src/filelock.c
@@
-1,14
+1,14
@@
/* Lock files for editing.
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1996, 1998, 1999, 2000, 2001,
/* Lock files for editing.
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1996, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008
, 2009, 2010
Free Software Foundation, Inc.
This file is part of GNU Emacs.
Free Software Foundation, Inc.
This file is part of GNU Emacs.
-GNU Emacs is free software
;
you can redistribute it and/or modify
+GNU Emacs is free software
:
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
-the Free Software Foundation
; either version 3, or (at your option)
-any later version.
+the Free Software Foundation
, either version 3 of the License, or
+
(at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-16,9
+16,7
@@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <config.h>
@@
-26,6
+24,7
@@
Boston, MA 02110-1301, USA. */
#include <sys/stat.h>
#include <signal.h>
#include <stdio.h>
#include <sys/stat.h>
#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
@@
-48,9
+47,6
@@
Boston, MA 02110-1301, USA. */
#endif /* __FreeBSD__ */
#include <errno.h>
#endif /* __FreeBSD__ */
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#include "lisp.h"
#include "buffer.h"
#include "lisp.h"
#include "buffer.h"
@@
-64,7
+60,9
@@
Lisp_Object Vtemporary_file_directory;
#ifdef CLASH_DETECTION
#ifdef CLASH_DETECTION
+#ifdef HAVE_UTMP_H
#include <utmp.h>
#include <utmp.h>
+#endif
#if !defined (S_ISLNK) && defined (S_IFLNK)
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#if !defined (S_ISLNK) && defined (S_IFLNK)
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
@@
-124,11
+122,11
@@
static int boot_time_initialized;
extern Lisp_Object Vshell_file_name;
#ifdef BOOT_TIME
extern Lisp_Object Vshell_file_name;
#ifdef BOOT_TIME
-static void get_boot_time_1
P_ ((char *, int)
);
+static void get_boot_time_1
(char *, int
);
#endif
static time_t
#endif
static time_t
-get_boot_time ()
+get_boot_time (
void
)
{
#if defined (BOOT_TIME)
int counter;
{
#if defined (BOOT_TIME)
int counter;
@@
-255,9
+253,7
@@
get_boot_time ()
Success is indicated by setting BOOT_TIME to a larger value. */
void
Success is indicated by setting BOOT_TIME to a larger value. */
void
-get_boot_time_1 (filename, newest)
- char *filename;
- int newest;
+get_boot_time_1 (char *filename, int newest)
{
struct utmp ut, *utp;
int desc;
{
struct utmp ut, *utp;
int desc;
@@
-328,9
+324,7
@@
typedef struct
fill_in_lock_file_name (lock, (file)))
static void
fill_in_lock_file_name (lock, (file)))
static void
-fill_in_lock_file_name (lockfile, fn)
- register char *lockfile;
- register Lisp_Object fn;
+fill_in_lock_file_name (register char *lockfile, register Lisp_Object fn)
{
register char *p;
struct stat st;
{
register char *p;
struct stat st;
@@
-366,9
+360,7
@@
fill_in_lock_file_name (lockfile, fn)
Return 1 if successful, 0 if not. */
static int
Return 1 if successful, 0 if not. */
static int
-lock_file_1 (lfname, force)
- char *lfname;
- int force;
+lock_file_1 (char *lfname, int force)
{
register int err;
time_t boot_time;
{
register int err;
time_t boot_time;
@@
-410,8
+402,7
@@
lock_file_1 (lfname, force)
/* Return 1 if times A and B are no more than one second apart. */
int
/* Return 1 if times A and B are no more than one second apart. */
int
-within_one_second (a, b)
- time_t a, b;
+within_one_second (time_t a, time_t b)
{
return (a - b >= -1 && a - b <= 1);
}
{
return (a - b >= -1 && a - b <= 1);
}
@@
-422,12
+413,10
@@
within_one_second (a, b)
or -1 if something is wrong with the locking mechanism. */
static int
or -1 if something is wrong with the locking mechanism. */
static int
-current_lock_owner (owner, lfname)
- lock_info_type *owner;
- char *lfname;
+current_lock_owner (lock_info_type *owner, char *lfname)
{
#ifndef index
{
#ifndef index
- extern char *rindex (
), *index (
);
+ extern char *rindex (
const char *, int), *index (const char *, int
);
#endif
int len, ret;
int local_owner = 0;
#endif
int len, ret;
int local_owner = 0;
@@
-542,9
+531,7
@@
current_lock_owner (owner, lfname)
Return -1 if cannot lock for any other reason. */
static int
Return -1 if cannot lock for any other reason. */
static int
-lock_if_free (clasher, lfname)
- lock_info_type *clasher;
- register char *lfname;
+lock_if_free (lock_info_type *clasher, register char *lfname)
{
while (lock_file_1 (lfname, 0) == 0)
{
{
while (lock_file_1 (lfname, 0) == 0)
{
@@
-587,8
+574,7
@@
lock_if_free (clasher, lfname)
take away the lock, or return nil meaning ignore the lock. */
void
take away the lock, or return nil meaning ignore the lock. */
void
-lock_file (fn)
- Lisp_Object fn;
+lock_file (Lisp_Object fn)
{
register Lisp_Object attack, orig_fn, encoded_fn;
register char *lfname, *locker;
{
register Lisp_Object attack, orig_fn, encoded_fn;
register char *lfname, *locker;
@@
-647,8
+633,7
@@
lock_file (fn)
}
void
}
void
-unlock_file (fn)
- register Lisp_Object fn;
+unlock_file (register Lisp_Object fn)
{
register char *lfname;
{
register char *lfname;
@@
-662,7
+647,7
@@
unlock_file (fn)
}
void
}
void
-unlock_all_files ()
+unlock_all_files (
void
)
{
register Lisp_Object tail;
register struct buffer *b;
{
register Lisp_Object tail;
register struct buffer *b;
@@
-711,8
+696,7
@@
should not be locked in that case. */)
/* Unlock the file visited in buffer BUFFER. */
void
/* Unlock the file visited in buffer BUFFER. */
void
-unlock_buffer (buffer)
- struct buffer *buffer;
+unlock_buffer (struct buffer *buffer)
{
if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer)
&& STRINGP (buffer->file_truename))
{
if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer)
&& STRINGP (buffer->file_truename))
@@
-752,14
+736,14
@@
t if it is locked by you, else a string saying which user has locked it. */)
/* Initialization functions. */
void
/* Initialization functions. */
void
-init_filelock ()
+init_filelock (
void
)
{
boot_time = 0;
boot_time_initialized = 0;
}
void
{
boot_time = 0;
boot_time_initialized = 0;
}
void
-syms_of_filelock ()
+syms_of_filelock (
void
)
{
DEFVAR_LISP ("temporary-file-directory", &Vtemporary_file_directory,
doc: /* The directory for writing temporary files. */);
{
DEFVAR_LISP ("temporary-file-directory", &Vtemporary_file_directory,
doc: /* The directory for writing temporary files. */);