Mercurial > hg > xemacs-beta
comparison src/filelock.c @ 382:064ab7fed2e0 r21-2-6
Import from CVS: tag r21-2-6
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:07:39 +0200 |
parents | 6240c7796c7a |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
381:908a86f940e6 | 382:064ab7fed2e0 |
---|---|
155 or -1 if something is wrong with the locking mechanism. */ | 155 or -1 if something is wrong with the locking mechanism. */ |
156 | 156 |
157 static int | 157 static int |
158 current_lock_owner (lock_info_type *owner, char *lfname) | 158 current_lock_owner (lock_info_type *owner, char *lfname) |
159 { | 159 { |
160 #ifndef index | |
161 extern char *rindex (), *index (); | |
162 #endif | |
163 int o, p, len, ret; | 160 int o, p, len, ret; |
164 int local_owner = 0; | 161 int local_owner = 0; |
165 char *at, *dot; | 162 char *at, *dot; |
166 char *lfinfo = 0; | 163 char *lfinfo = 0; |
167 int bufsize = 50; | 164 int bufsize = 50; |
193 local_owner = 1; | 190 local_owner = 1; |
194 } | 191 } |
195 | 192 |
196 /* Parse USER@HOST.PID. If can't parse, return -1. */ | 193 /* Parse USER@HOST.PID. If can't parse, return -1. */ |
197 /* The USER is everything before the first @. */ | 194 /* The USER is everything before the first @. */ |
198 at = index (lfinfo, '@'); | 195 at = strchr (lfinfo, '@'); |
199 dot = rindex (lfinfo, '.'); | 196 dot = strrchr (lfinfo, '.'); |
200 if (!at || !dot) { | 197 if (!at || !dot) { |
201 xfree (lfinfo); | 198 xfree (lfinfo); |
202 return -1; | 199 return -1; |
203 } | 200 } |
204 len = at - lfinfo; | 201 len = at - lfinfo; |