#include <lockfile.h>
#endif
-#ifdef LOCKDIR
+#ifdef DOT_LOCKING
+# ifdef LOCKDIR
char *lockdir = LOCKDIR;
+# endif
#endif
/* Are we using any kernel locking? */
struct lock *lp;
size_t len;
- lp = (struct lock *) mh_xmalloc(sizeof(*lp));
+ lp = mh_xcalloc(1, sizeof(*lp));
len = strlen(curlock) + 1;
lp->l_fd = fd;
- lp->l_lock = mh_xmalloc(len);
+ lp->l_lock = mh_xcalloc(len, sizeof(char));
memcpy(lp->l_lock, curlock, len);
lp->l_next = l_top;
else
pp->l_next = lp->l_next;
- free(lp->l_lock);
- free(lp);
+ mh_free0(&(lp->l_lock));
+ mh_free0(&lp);
}
}