diff options
Diffstat (limited to 'src/lock.c')
-rw-r--r-- | src/lock.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -175,23 +175,24 @@ expire_stale_lock (const char *file) } int wydawca_lock (const char *lockname) { char *tempname = NULL; + size_t size = 0; int rc; if (!enable_locking) return 0; expire_stale_lock (lockname); /* build the NFS hitching-post to the lock file */ - asprintf (&tempname, "%s.%lu.%lu.%s", - lockname, - (unsigned long) getpid (), - (unsigned long) time (NULL), xgethostname ()); + grecs_asprintf (&tempname, &size, "%s.%lu.%lu.%s", + lockname, + (unsigned long) getpid (), + (unsigned long) time (NULL), xgethostname ()); if (!tempname) return LOCK_FAILURE; if (lock_timeout) { time_t start = time (NULL); @@ -232,14 +233,15 @@ fix_tagname (const char *tag) } char * wydawca_lockname (const char *tag) { char *lockname = NULL; + size_t size = 0; char *tagname = fix_tagname (tag); - asprintf (&lockname, "%s/LCK.%s", lockdir, tagname); + grecs_asprintf (&lockname, &size, "%s/LCK.%s", lockdir, tagname); if (!lockname) xalloc_die (); free (tagname); return lockname; } |