/[emacs]/emacs/src/filelock.c
ViewVC logotype

Diff of /emacs/src/filelock.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.96 by rms, Wed Feb 6 15:44:28 2002 UTC revision 1.97 by raeburn, Mon Jul 15 00:00:36 2002 UTC
# Line 222  get_boot_time () Line 222  get_boot_time ()
222                args[3] = Qnil;                args[3] = Qnil;
223                args[4] = build_string ("-c");                args[4] = build_string ("-c");
224                sprintf (cmd_string, "gunzip < %s.%d.gz > %s",                sprintf (cmd_string, "gunzip < %s.%d.gz > %s",
225                         WTMP_FILE, counter, XSTRING (tempname)->data);                         WTMP_FILE, counter, SDATA (tempname));
226                args[5] = build_string (cmd_string);                args[5] = build_string (cmd_string);
227                Fcall_process (6, args);                Fcall_process (6, args);
228                filename = tempname;                filename = tempname;
# Line 232  get_boot_time () Line 232  get_boot_time ()
232    
233        if (! NILP (filename))        if (! NILP (filename))
234          {          {
235            get_boot_time_1 (XSTRING (filename)->data, 1);            get_boot_time_1 (SDATA (filename), 1);
236            if (delete_flag)            if (delete_flag)
237              unlink (XSTRING (filename)->data);              unlink (SDATA (filename));
238          }          }
239      }      }
240    
# Line 325  typedef struct Line 325  typedef struct
325     trailing period plus one for the digit after it plus one for the     trailing period plus one for the digit after it plus one for the
326     null.  */     null.  */
327  #define MAKE_LOCK_NAME(lock, file) \  #define MAKE_LOCK_NAME(lock, file) \
328    (lock = (char *) alloca (STRING_BYTES (XSTRING (file)) + 2 + 1 + 1 + 1), \    (lock = (char *) alloca (SBYTES (file) + 2 + 1 + 1 + 1), \
329     fill_in_lock_file_name (lock, (file)))     fill_in_lock_file_name (lock, (file)))
330    
331  static void  static void
# Line 337  fill_in_lock_file_name (lockfile, fn) Line 337  fill_in_lock_file_name (lockfile, fn)
337    struct stat st;    struct stat st;
338    int count = 0;    int count = 0;
339    
340    strcpy (lockfile, XSTRING (fn)->data);    strcpy (lockfile, SDATA (fn));
341    
342    /* Shift the nondirectory part of the file name (including the null)    /* Shift the nondirectory part of the file name (including the null)
343       right two characters.  Here is one of the places where we'd have to       right two characters.  Here is one of the places where we'd have to
# Line 378  lock_file_1 (lfname, force) Line 378  lock_file_1 (lfname, force)
378    char *lock_info_str;    char *lock_info_str;
379    
380    if (STRINGP (Fuser_login_name (Qnil)))    if (STRINGP (Fuser_login_name (Qnil)))
381      user_name = (char *)XSTRING (Fuser_login_name (Qnil))->data;      user_name = (char *)SDATA (Fuser_login_name (Qnil));
382    else    else
383      user_name = "";      user_name = "";
384    if (STRINGP (Fsystem_name ()))    if (STRINGP (Fsystem_name ()))
385      host_name = (char *)XSTRING (Fsystem_name ())->data;      host_name = (char *)SDATA (Fsystem_name ());
386    else    else
387      host_name = "";      host_name = "";
388    lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)    lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)
# Line 503  current_lock_owner (owner, lfname) Line 503  current_lock_owner (owner, lfname)
503        
504    /* On current host?  */    /* On current host?  */
505    if (STRINGP (Fsystem_name ())    if (STRINGP (Fsystem_name ())
506        && strcmp (owner->host, XSTRING (Fsystem_name ())->data) == 0)        && strcmp (owner->host, SDATA (Fsystem_name ())) == 0)
507      {      {
508        if (owner->pid == getpid ())        if (owner->pid == getpid ())
509          ret = 2; /* We own it.  */          ret = 2; /* We own it.  */

Legend:
Removed from v.1.96  
changed lines
  Added in v.1.97

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26