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, 6 insertions, 6 deletions
diff --git a/src/lock.c b/src/lock.c
index 32367de..dece75d 100644
--- a/src/lock.c
+++ b/src/lock.c
@@ -178,33 +178,33 @@ host_name ()
static char *hostbuf = NULL;
size_t size = 0;
int rc;
if (hostbuf)
return hostbuf;
do
{
if (!hostbuf)
{
size = 256;
- hostbuf = xmalloc (size);
+ hostbuf = grecs_malloc (size);
}
else
{
size_t ns = size * 2;
if (size < ns)
- xalloc_die ();
+ grecs_alloc_die ();
size = ns;
- hostbuf = xrealloc (hostbuf, size);
+ hostbuf = grecs_realloc (hostbuf, size);
}
}
while ((rc = gethostname (hostbuf, size )) == -1 &&
(errno == EINVAL
#ifdef ENAMETOOLONG
|| errno == ENAMETOOLONG
#endif
));
if (rc)
{
logmsg (LOG_ERR, _("cannot get hostname: %s"), strerror (rc));
exit (EX_SOFTWARE);
@@ -252,45 +252,45 @@ wydawca_lock (const char *lockname)
}
void
wydawca_unlock (const char *lockfile)
{
if (enable_locking)
unlink (lockfile);
}
static char *
fix_tagname (const char *tag)
{
- char *tagname = xstrdup (tag);
+ char *tagname = grecs_strdup (tag);
char *p;
for (p = tagname; *p; p++)
if (!isalnum (*p) && *p != '_' && *p != '-')
*p = '_';
return tagname;
}
char *
wydawca_lockname (const char *tag)
{
char *lockname = NULL;
size_t size = 0;
char *tagname = fix_tagname (tag);
grecs_asprintf (&lockname, &size, "%s/LCK.%s", lockdir, tagname);
if (!lockname)
- xalloc_die ();
+ grecs_alloc_die ();
free (tagname);
return lockname;
}
void
wydawca_lock_init ()
{
if (enable_locking)
{
if (!lockdir)
- lockdir = xstrdup (LOCALSTATEDIR "/lock/" PACKAGE);
+ lockdir = grecs_strdup (LOCALSTATEDIR "/lock/" PACKAGE);
if (create_hierarchy (lockdir, 0))
exit (EX_OSFILE);
}
}

Return to:

Send suggestions and report system problems to the System administrator.