comparison src/filelock.c @ 16816:9bdccdf9388b

(lock_info_type): Declare pid as unsigned long instead of int. (lock_file_1): Use %lu instead of %d in printf.
author Richard M. Stallman <rms@gnu.org>
date Thu, 02 Jan 1997 21:02:23 +0000
parents 93fc7aff4cc2
children f919de623142
comparison
equal deleted inserted replaced
16815:9e0f59154164 16816:9bdccdf9388b
84 84
85 typedef struct 85 typedef struct
86 { 86 {
87 char *user; 87 char *user;
88 char *host; 88 char *host;
89 int pid; 89 unsigned long pid;
90 } lock_info_type; 90 } lock_info_type;
91 91
92 /* When we read the info back, we might need this much more. */ 92 /* When we read the info back, we might need this much more. */
93 #define LOCK_PID_MAX 21 /* enough for signed 64 bits plus null */ 93 #define LOCK_PID_MAX 21 /* enough for signed 64 bits plus null */
94 94
134 register int err; 134 register int err;
135 char *user_name = XSTRING (Fuser_login_name (Qnil))->data; 135 char *user_name = XSTRING (Fuser_login_name (Qnil))->data;
136 char *host_name = XSTRING (Fsystem_name ())->data; 136 char *host_name = XSTRING (Fsystem_name ())->data;
137 char *lock_info_str = alloca (strlen (user_name) + strlen (host_name) + 21); 137 char *lock_info_str = alloca (strlen (user_name) + strlen (host_name) + 21);
138 138
139 sprintf (lock_info_str, "%s@%s.%d", user_name, host_name, getpid ()); 139 sprintf (lock_info_str, "%s@%s.%lu", user_name, host_name,
140 (unsigned long) getpid ());
140 141
141 err = symlink (lock_info_str, lfname); 142 err = symlink (lock_info_str, lfname);
142 if (errno == EEXIST && force) 143 if (errno == EEXIST && force)
143 { 144 {
144 unlink (lfname); 145 unlink (lfname);