diff src/filelock.c @ 647:b39c14581166

[xemacs-hg @ 2001-08-13 04:45:47 by ben] removal of unsigned, size_t, etc.
author ben
date Mon, 13 Aug 2001 04:46:48 +0000
parents 023b83f4e54b
children fdefd0186b75
line wrap: on
line diff
--- a/src/filelock.c	Wed Aug 08 12:15:04 2001 +0000
+++ b/src/filelock.c	Mon Aug 13 04:46:48 2001 +0000
@@ -81,12 +81,12 @@
 {
   char *user;
   char *host;
-  unsigned long pid;
+  pid_t pid;
 } lock_info_type;
 
 /* When we read the info back, we might need this much more,
    enough for decimal representation plus null.  */
-#define LOCK_PID_MAX (4 * sizeof (unsigned long))
+#define LOCK_PID_MAX (4 * sizeof (pid_t))
 
 /* Free the two dynamically-allocated pieces in PTR.  */
 #define FREE_LOCK_INFO(i) do { xfree ((i).user); xfree ((i).host); } while (0)
@@ -102,7 +102,7 @@
 {
   Bufbyte *file_name = XSTRING_DATA (fn);
   Bufbyte *p;
-  size_t dirlen;
+  Bytecount dirlen;
 
   for (p = file_name + XSTRING_LENGTH (fn) - 1;
        p > file_name && !IS_ANY_SEP (p[-1]);
@@ -141,8 +141,7 @@
   lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name)
 			  + LOCK_PID_MAX + 5);
 
-  sprintf (lock_info_str, "%s@%s.%lu", user_name, host_name,
-           (unsigned long) getpid ());
+  sprintf (lock_info_str, "%s@%s.%d", user_name, host_name, getpid ());
 
   err = symlink (lock_info_str, lfname);
   if (err != 0 && errno == EEXIST && force)
@@ -349,7 +348,7 @@
   /* Else consider breaking the lock */
   locker = (char *) alloca (strlen (lock_info.user) + strlen (lock_info.host)
 			    + LOCK_PID_MAX + 9);
-  sprintf (locker, "%s@%s (pid %lu)", lock_info.user, lock_info.host,
+  sprintf (locker, "%s@%s (pid %d)", lock_info.user, lock_info.host,
            lock_info.pid);
   FREE_LOCK_INFO (lock_info);