-
-void zebraServerLockMsg (const char *str)
-{
- int l, r;
-
- assert (server_lock_fd != -1);
- lseek (server_lock_fd, 0L, SEEK_SET);
- l = strlen(str);
- r = write (server_lock_fd, str, l);
- if (r != l)
- {
- logf (LOG_FATAL|LOG_ERRNO, "write server lock file");
- exit (1);
- }
-}
-
-void zebraServerUnlock (void)
-{
- char pathPrefix[1024];
- char path[1024];
-
- assert (server_lock_fd != -1);
- zebraLockPrefix (pathPrefix);
- flock (server_lock_fd, LOCK_UN);
- sprintf (path, "%szebrasrv.%ld", pathPrefix, (long) getpid());
- unlink (path);
-}
-