aboutsummaryrefslogtreecommitdiff
path: root/src/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lock.c')
-rw-r--r--src/lock.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lock.c b/src/lock.c
index 1c3a657..bc8505c 100644
--- a/src/lock.c
+++ b/src/lock.c
@@ -178,6 +178,7 @@ int
178wydawca_lock (const char *lockname) 178wydawca_lock (const char *lockname)
179{ 179{
180 char *tempname = NULL; 180 char *tempname = NULL;
181 size_t size = 0;
181 int rc; 182 int rc;
182 183
183 if (!enable_locking) 184 if (!enable_locking)
@@ -185,10 +186,10 @@ wydawca_lock (const char *lockname)
185 expire_stale_lock (lockname); 186 expire_stale_lock (lockname);
186 187
187 /* build the NFS hitching-post to the lock file */ 188 /* build the NFS hitching-post to the lock file */
188 asprintf (&tempname, "%s.%lu.%lu.%s", 189 grecs_asprintf (&tempname, &size, "%s.%lu.%lu.%s",
189 lockname, 190 lockname,
190 (unsigned long) getpid (), 191 (unsigned long) getpid (),
191 (unsigned long) time (NULL), xgethostname ()); 192 (unsigned long) time (NULL), xgethostname ());
192 if (!tempname) 193 if (!tempname)
193 return LOCK_FAILURE; 194 return LOCK_FAILURE;
194 if (lock_timeout) 195 if (lock_timeout)
@@ -235,8 +236,9 @@ char *
235wydawca_lockname (const char *tag) 236wydawca_lockname (const char *tag)
236{ 237{
237 char *lockname = NULL; 238 char *lockname = NULL;
239 size_t size = 0;
238 char *tagname = fix_tagname (tag); 240 char *tagname = fix_tagname (tag);
239 asprintf (&lockname, "%s/LCK.%s", lockdir, tagname); 241 grecs_asprintf (&lockname, &size, "%s/LCK.%s", lockdir, tagname);
240 if (!lockname) 242 if (!lockname)
241 xalloc_die (); 243 xalloc_die ();
242 free (tagname); 244 free (tagname);

Return to:

Send suggestions and report system problems to the System administrator.